]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bsod: remove some duplicate logging
authorLennart Poettering <lennart@poettering.net>
Tue, 20 Feb 2024 14:42:10 +0000 (15:42 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 21 Feb 2024 14:11:27 +0000 (15:11 +0100)
display_emergency_message_fullscreen() already logs about all erros,
hence don't log again.

src/journal/bsod.c

index 65107981c8d5dc27ec7c030e02f4ea640dc51cf9..046858e8a6482ff06b484b1dad91b3f2071a5976 100644 (file)
@@ -136,7 +136,7 @@ static int find_next_free_vt(int fd, int *ret_free_vt, int *ret_original_vt) {
                         return 0;
                 }
 
-        return log_error_errno(SYNTHETIC_ERRNO(ENOTTY), "No free VT found: %m");
+        return -ENOTTY;
 }
 
 static int display_emergency_message_fullscreen(const char *message) {
@@ -314,7 +314,7 @@ static int run(int argc, char *argv[]) {
 
         r = acquire_first_emergency_log_message(&message);
         if (r < 0)
-                return log_error_errno(r, "Failed to acquire first emergency log message: %m");
+                return r;
 
         if (!message) {
                 log_debug("No emergency-level entries");
@@ -323,11 +323,7 @@ static int run(int argc, char *argv[]) {
 
         assert_se(sigaction_many(&nop_sigaction, SIGTERM, SIGINT) >= 0);
 
-        r = display_emergency_message_fullscreen((const char*) message);
-        if (r < 0)
-                return log_error_errno(r, "Failed to display emergency message on terminal: %m");
-
-        return 0;
+        return display_emergency_message_fullscreen(message);
 }
 
 DEFINE_MAIN_FUNCTION(run);