From 2c4702057b4a36923fcbd4db264223bd80850adc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 10 Jun 2020 16:54:10 +0200 Subject: sleep: pass error we see to log function --- src/sleep/sleep.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/sleep') 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; -- cgit v1.2.1