]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sleep: remove duplicate logging
authorLennart Poettering <lennart@poettering.net>
Fri, 21 May 2021 16:39:06 +0000 (18:39 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 22 May 2021 09:00:04 +0000 (11:00 +0200)
execute() logs about all errors, hence only log about what's new, i.e.
what we'll do as consequence, and don't mention the error cause again.

src/sleep/sleep.c

index 86b155c9ea8a19b03a168dfbe96cc438c32f98b9..8f6bd40c5c791f10d8b7acc07fe1a58da62aab68 100644 (file)
@@ -303,11 +303,11 @@ static int execute_s2h(const SleepConfig *sleep_config) {
 
         r = execute(sleep_config, SLEEP_HIBERNATE, NULL);
         if (r < 0) {
-                log_notice_errno(r, "Couldn't hibernate, will try to suspend again: %m");
+                log_notice("Couldn't hibernate, will try to suspend again.");
 
                 r = execute(sleep_config, SLEEP_SUSPEND, "suspend-after-failed-hibernate");
                 if (r < 0)
-                        return log_error_errno(r, "Could neither hibernate nor suspend, giving up: %m");
+                        return r;
         }
 
         return 0;