]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Fix check for signal in set (#5416)
authorstuart-mclaren <stuart.mclaren@hp.com>
Tue, 21 Feb 2017 20:39:52 +0000 (20:39 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 21 Feb 2017 20:39:52 +0000 (15:39 -0500)
IN_SET(SIGCONT, SIGKILL) will always evaluate to false.
The signal needs to be included as the first argument.

Fixup for 26f417d3e8dd2522adfdc4c8fed4c36fa40f48fc.

src/basic/process-util.c

index eead8b00dae35d4528a71036272a22d139b03c56..87e5586027840f060ea1bcf51f70154975e9cfec 100644 (file)
@@ -703,7 +703,7 @@ int kill_and_sigcont(pid_t pid, int sig) {
 
         /* 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))
+        if (r >= 0 && !IN_SET(sig, SIGCONT, SIGKILL))
                 (void) kill(pid, SIGCONT);
 
         return r;