diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-06-10 16:54:10 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-06-11 10:35:04 +0200 |
commit | 2c4702057b4a36923fcbd4db264223bd80850adc (patch) | |
tree | 9e8dc61cea2c8022a9cdfaf9d8813d2cfd437477 /src | |
parent | 1326de01588a765e96ed5b187566d10655aacc01 (diff) | |
download | systemd-2c4702057b4a36923fcbd4db264223bd80850adc.tar.gz |
sleep: pass error we see to log function
Diffstat (limited to 'src')
-rw-r--r-- | src/sleep/sleep.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index 82e31fe704..f494ca6ffb 100644 --- a/src/sleep/sleep.c +++ b/src/sleep/sleep.c @@ -108,6 +108,9 @@ static int write_state(FILE **f, char **states) { char **state; int r = 0; + assert(f); + assert(*f); + STRV_FOREACH(state, states) { int k; @@ -277,11 +280,11 @@ static int execute_s2h(const SleepConfig *sleep_config) { r = execute(sleep_config->hibernate_modes, sleep_config->hibernate_states); if (r < 0) { - log_notice_errno(r, "Couldn't hibernate, will try to suspend again."); + log_notice_errno(r, "Couldn't hibernate, will try to suspend again: %m"); r = execute(sleep_config->suspend_modes, sleep_config->suspend_states); if (r < 0) - return log_notice_errno(r, "Could neither hibernate nor suspend again, giving up."); + return log_error_errno(r, "Could neither hibernate nor suspend, giving up: %m"); } return 0; |