diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2016-07-22 09:18:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-22 09:18:30 +0200 |
commit | bf3dd08a81f7500973d8a4add8c73a0856ae5f7d (patch) | |
tree | 0610e6bcaa4aaf00acbe4859e4b7253bf8040d03 /src/basic/process-util.c | |
parent | 5c3c778014f4c59dd97f31ca5ab2e7374f08bbf6 (diff) | |
parent | 756ed0e238b7243c2e4616083e838d90de6e33ed (diff) |
Merge pull request #3762 from poettering/sigkill-log
log about all processes we forcibly kill
Diffstat (limited to 'src/basic/process-util.c')
-rw-r--r-- | src/basic/process-util.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/basic/process-util.c b/src/basic/process-util.c index e38b67405e..54b644ad56 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -625,8 +625,10 @@ int kill_and_sigcont(pid_t pid, int sig) { r = kill(pid, sig) < 0 ? -errno : 0; - if (r >= 0) - kill(pid, SIGCONT); + /* If this worked, also send SIGCONT, unless we already just sent a SIGCONT, or SIGKILL was sent which isn't + * affected by a process being suspended anyway. */ + if (r >= 0 && !IN_SET(SIGCONT, SIGKILL)) + (void) kill(pid, SIGCONT); return r; } |