From 615279f369aa4116e21704386090570dc42f4a55 Mon Sep 17 00:00:00 2001 From: Benjamin ROBIN Date: Sun, 6 Oct 2024 17:02:06 +0200 Subject: [PATCH] shutdown: In sync_with_progress(), log first then send SIGKILL The order of these 2 lines was swapped in commit 758760a3610e3c6674de8a1d51b12b991eafef7c. Put them in the right order, and take yuwata's comment into account. --- src/shutdown/shutdown.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c index e6c9e0f806..57bb9a82d0 100644 --- a/src/shutdown/shutdown.c +++ b/src/shutdown/shutdown.c @@ -268,11 +268,10 @@ int sync_with_progress(int fd) { } /* Only reached in the event of a timeout. We should issue a kill to the stray process. */ + r = log_error_errno(SYNTHETIC_ERRNO(ETIMEDOUT), + "Syncing %s - timed out, issuing SIGKILL to PID "PID_FMT".", what, pid); (void) kill(pid, SIGKILL); - return log_error_errno(SYNTHETIC_ERRNO(ETIMEDOUT), - "Syncing %s - timed out, issuing SIGKILL to PID "PID_FMT".", - what, - pid); + return r; } static int read_current_sysctl_printk_log_level(void) { -- 2.25.1