diff options
author | Mario Limonciello <mario.limonciello@dell.com> | 2018-03-29 08:56:23 -0500 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | b8852851bebc7ccf7deee357d85215e556afcd4b (patch) | |
tree | 02cdf277d0501b6066a8e17c5e75feea401c03c9 | |
parent | 5a59b1ebb02430ccba5b51cc00075c28fc720d2f (diff) |
sleep: Move the error level debugging for write_mode and write_state
This makes it more consistent with other code used in the file.
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
-rw-r--r-- | src/sleep/sleep.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index b958e5c6f..9b5aa6264 100644 --- a/src/sleep/sleep.c +++ b/src/sleep/sleep.c @@ -123,9 +123,6 @@ static int write_mode(char **modes) { r = k; } - if (r < 0) - log_error_errno(r, "Failed to write mode to /sys/power/disk: %m"); - return r; } @@ -147,7 +144,7 @@ static int write_state(FILE **f, char **states) { fclose(*f); *f = fopen("/sys/power/state", "we"); if (!*f) - return log_error_errno(errno, "Failed to open /sys/power/state: %m"); + return -errno; } return r; @@ -182,7 +179,7 @@ static int execute(char **modes, char **states) { return log_error_errno(r, "Failed to write hibernation disk offset: %m"); r = write_mode(modes); if (r < 0) - return r; + return log_error_errno(r, "Failed to write mode to /sys/power/disk: %m");; } execute_directories(dirs, DEFAULT_TIMEOUT_USEC, NULL, NULL, arguments); @@ -195,7 +192,7 @@ static int execute(char **modes, char **states) { r = write_state(&f, states); if (r < 0) - return r; + return log_error_errno(r, "Failed to write /sys/power/state: %m"); log_struct(LOG_INFO, "MESSAGE_ID=" SD_MESSAGE_SLEEP_STOP_STR, |