From 8b23b9e5e55aaf3d90b445ad6990b56074a32bc0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 20 Feb 2024 15:42:10 +0100 Subject: [PATCH] bsod: remove some duplicate logging display_emergency_message_fullscreen() already logs about all erros, hence don't log again. --- src/journal/bsod.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/journal/bsod.c b/src/journal/bsod.c index 65107981c8d..046858e8a64 100644 --- a/src/journal/bsod.c +++ b/src/journal/bsod.c @@ -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); -- 2.47.3