]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sleep: pass error we see to log function 16137/head
authorLennart Poettering <lennart@poettering.net>
Wed, 10 Jun 2020 14:54:10 +0000 (16:54 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 11 Jun 2020 08:35:04 +0000 (10:35 +0200)
src/sleep/sleep.c

index 82e31fe704de713cda9a7bc772fa11098da721d4..f494ca6ffb8ccb02d03a81de4540d38cd2818a13 100644 (file)
@@ -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;