summaryrefslogtreecommitdiff
path: root/src/sleep
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 17:09:20 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 17:17:51 +0100
commitc33b329709ebe2755181980a050d02ec7c81ed87 (patch)
tree39080c428c72c90daddbe1c08d45c181adf1476c /src/sleep
parent5567fafbc9d83a1391f23ecdbe698a3c03929370 (diff)
treewide: more log_*_errno() conversions, multiline calls
Basically: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \ $f; done Plus manual indentation fixups.
Diffstat (limited to 'src/sleep')
-rw-r--r--src/sleep/sleep.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
index 0d7c1e3fbe..6261502588 100644
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -48,15 +48,14 @@ static int write_mode(char **modes) {
if (k == 0)
return 0;
- log_debug("Failed to write '%s' to /sys/power/disk: %s",
- *mode, strerror(-k));
+ log_debug_errno(k, "Failed to write '%s' to /sys/power/disk: %m",
+ *mode);
if (r == 0)
r = k;
}
if (r < 0)
- log_error("Failed to write mode to /sys/power/disk: %s",
- strerror(-r));
+ log_error_errno(r, "Failed to write mode to /sys/power/disk: %m");
return r;
}
@@ -71,8 +70,8 @@ static int write_state(FILE **f, char **states) {
k = write_string_stream(*f, *state);
if (k == 0)
return 0;
- log_debug("Failed to write '%s' to /sys/power/state: %s",
- *state, strerror(-k));
+ log_debug_errno(k, "Failed to write '%s' to /sys/power/state: %m",
+ *state);
if (r == 0)
r = k;