From: Benjamin ROBIN Date: Sun, 6 Oct 2024 15:02:06 +0000 (+0200) Subject: shutdown: In sync_with_progress(), log first then send SIGKILL X-Git-Tag: v257-rc1~318 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=615279f369aa4116e21704386090570dc42f4a55;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c index e6c9e0f8066..57bb9a82d01 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) {