mirror of
https://github.com/systemd/systemd.git
synced 2024-12-05 00:04:02 +08:00
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.
This commit is contained in:
parent
a70877d881
commit
2c1612100d
@ -857,7 +857,7 @@ 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) kill(pid, SIGKILL);
|
||||
(void) wait_for_terminate(pid, NULL);
|
||||
}
|
||||
|
||||
@ -875,7 +875,7 @@ void sigkill_waitp(pid_t *pid) {
|
||||
void sigterm_wait(pid_t pid) {
|
||||
assert(pid > 1);
|
||||
|
||||
if (kill_and_sigcont(pid, SIGTERM) >= 0)
|
||||
(void) kill_and_sigcont(pid, SIGTERM);
|
||||
(void) wait_for_terminate(pid, NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user