summaryrefslogtreecommitdiff
path: root/src/sleep/sleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sleep/sleep.c')
-rw-r--r--src/sleep/sleep.c7
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;