]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shutdown: In sync_with_progress(), log first then send SIGKILL
authorBenjamin ROBIN <dev@benjarobin.fr>
Sun, 6 Oct 2024 15:02:06 +0000 (17:02 +0200)
committerMike Yuan <me@yhndnzj.com>
Sun, 6 Oct 2024 17:56:49 +0000 (19:56 +0200)
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

index e6c9e0f8066303de1acd13c1613ee5749a68f4ae..57bb9a82d01c78ce201dc6fd7f832c74e3f642a3 100644 (file)
@@ -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) {