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/hibernate-resume | |
parent | core: fix return value in error path after sd_event_add_io() failure (diff) | |
download | systemd-56f64d95763a799ba4475daf44d8e9f72a1bd474.tar.xz systemd-56f64d95763a799ba4475daf44d8e9f72a1bd474.zip |
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/hibernate-resume')
-rw-r--r-- | src/hibernate-resume/hibernate-resume-generator.c | 2 | ||||
-rw-r--r-- | src/hibernate-resume/hibernate-resume.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/hibernate-resume/hibernate-resume-generator.c b/src/hibernate-resume/hibernate-resume-generator.c index b8c4bafc05..25cefc2b24 100644 --- a/src/hibernate-resume/hibernate-resume-generator.c +++ b/src/hibernate-resume/hibernate-resume-generator.c @@ -58,7 +58,7 @@ static int process_resume(void) { mkdir_parents_label(lnk, 0755); if (symlink(SYSTEM_DATA_UNIT_PATH "/systemd-hibernate-resume@.service", lnk) < 0) { - log_error("Failed to create symlink %s: %m", lnk); + log_error_errno(errno, "Failed to create symlink %s: %m", lnk); return -errno; } diff --git a/src/hibernate-resume/hibernate-resume.c b/src/hibernate-resume/hibernate-resume.c index b1d5ffdb3f..f28eabbe37 100644 --- a/src/hibernate-resume/hibernate-resume.c +++ b/src/hibernate-resume/hibernate-resume.c @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) { device = argv[1]; if (stat(device, &st) < 0) { - log_error("Failed to stat '%s': %m", device); + log_error_errno(errno, "Failed to stat '%s': %m", device); return EXIT_FAILURE; } |