projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a70877d
)
process-util: wait for processes we killed even if killing failed
author
Lennart Poettering
<lennart@poettering.net>
Wed, 3 Nov 2021 14:54:28 +0000
(15:54 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 3 Nov 2021 14:57:02 +0000
(15:57 +0100)
The processes might be zombies in which case killing will fail, but
reaping them still matters.
src/basic/process-util.c
patch
|
blob
|
history
diff --git
a/src/basic/process-util.c
b/src/basic/process-util.c
index 06493f77995f548957c41bf456c60fac92e41ed7..82bbda895fb6b321024d591ad0aaecc00a34f0be 100644
(file)
--- 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) {