Skip to content

Commit

Permalink
shl: log: don't use strerror()
Browse files Browse the repository at this point in the history
strerror() is not re-entrant safe so we should use %m instead.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
  • Loading branch information
David Herrmann committed Nov 3, 2013
1 parent 37eae95 commit 7e095d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shl_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7e095d9

Please sign in to comment.