util: don't send SIGCONT following a SIGCONT or SIGKILL in kill_and_sigcont()

This commit is contained in:
Lennart Poettering 2016-07-20 11:14:48 +02:00
parent 801a884d1e
commit 26f417d3e8
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}