shl: log: don't use strerror()
authorDavid Herrmann <dh.herrmann@gmail.com>
Sat, 16 Mar 2013 15:03:30 +0000 (16:03 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Sun, 3 Nov 2013 11:24:14 +0000 (12:24 +0100)
strerror() is not re-entrant safe so we should use %m instead.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
src/shl_log.c

index 5b726a4..5318710 100644 (file)
@@ -320,8 +320,8 @@ int log_set_file(const char *file)
        if (file) {
                f = fopen(file, "a");
                if (!f) {
-                       log_err("cannot change log-file to %s (%d): %s",
-                               file, errno, strerror(errno));
+                       log_err("cannot change log-file to %s (%d): %m",
+                               file, errno);
                        return -EFAULT;
                }
        } else {