From: Lennart Poettering Date: Wed, 3 Nov 2021 14:54:28 +0000 (+0100) Subject: process-util: wait for processes we killed even if killing failed X-Git-Tag: v250-rc1~364^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c1612100daae9cef1b71c06ae4c4ec5f9378f09;p=thirdparty%2Fsystemd.git process-util: wait for processes we killed even if killing failed The processes might be zombies in which case killing will fail, but reaping them still matters. --- diff --git a/src/basic/process-util.c b/src/basic/process-util.c index 06493f77995..82bbda895fb 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -857,8 +857,8 @@ int wait_for_terminate_with_timeout(pid_t pid, usec_t timeout) { void sigkill_wait(pid_t pid) { assert(pid > 1); - if (kill(pid, SIGKILL) >= 0) - (void) wait_for_terminate(pid, NULL); + (void) kill(pid, SIGKILL); + (void) wait_for_terminate(pid, NULL); } void sigkill_waitp(pid_t *pid) { @@ -875,8 +875,8 @@ void sigkill_waitp(pid_t *pid) { void sigterm_wait(pid_t pid) { assert(pid > 1); - if (kill_and_sigcont(pid, SIGTERM) >= 0) - (void) wait_for_terminate(pid, NULL); + (void) kill_and_sigcont(pid, SIGTERM); + (void) wait_for_terminate(pid, NULL); } int kill_and_sigcont(pid_t pid, int sig) {