Skip to content

Commit

Permalink
util: don't send SIGCONT following a SIGCONT or SIGKILL in kill_and_s…
Browse files Browse the repository at this point in the history
…igcont()
  • Loading branch information
poettering committed Jul 20, 2016
1 parent 801a884 commit 26f417d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/basic/process-util.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 26f417d

Please sign in to comment.