diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 19:29:59 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 19:49:27 +0100 |
commit | 56f64d95763a799ba4475daf44d8e9f72a1bd474 (patch) | |
tree | 4c38253c718dc1972b811fa7c01ebfa3c2b7776c /src/shared/pager.c | |
parent | 895b3a7b44fe7ca2f260986be2a877ff56a72718 (diff) |
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'
Plus some whitespace, linewrap, and indent adjustments.
Diffstat (limited to 'src/shared/pager.c')
-rw-r--r-- | src/shared/pager.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shared/pager.c b/src/shared/pager.c index aa74bab103..2863940725 100644 --- a/src/shared/pager.c +++ b/src/shared/pager.c @@ -40,7 +40,7 @@ noreturn static void pager_fallback(void) { } while (n > 0); if (n < 0) { - log_error("Internal pager failed: %m"); + log_error_errno(errno, "Internal pager failed: %m"); _exit(EXIT_FAILURE); } @@ -68,7 +68,7 @@ int pager_open(bool jump_to_end) { columns(); if (pipe(fd) < 0) { - log_error("Failed to create pager pipe: %m"); + log_error_errno(errno, "Failed to create pager pipe: %m"); return -errno; } @@ -77,7 +77,7 @@ int pager_open(bool jump_to_end) { pager_pid = fork(); if (pager_pid < 0) { r = -errno; - log_error("Failed to fork pager: %m"); + log_error_errno(errno, "Failed to fork pager: %m"); safe_close_pair(fd); return r; } @@ -127,7 +127,7 @@ int pager_open(bool jump_to_end) { /* Return in the parent */ if (dup2(fd[1], STDOUT_FILENO) < 0) { - log_error("Failed to duplicate pager pipe: %m"); + log_error_errno(errno, "Failed to duplicate pager pipe: %m"); return -errno; } @@ -177,7 +177,7 @@ int show_man_page(const char *desc, bool null_stdio) { pid = fork(); if (pid < 0) { - log_error("Failed to fork: %m"); + log_error_errno(errno, "Failed to fork: %m"); return -errno; } @@ -192,7 +192,7 @@ int show_man_page(const char *desc, bool null_stdio) { } execvp(args[0], (char**) args); - log_error("Failed to execute man: %m"); + log_error_errno(errno, "Failed to execute man: %m"); _exit(EXIT_FAILURE); } |