]> granicus.if.org Git - procps-ng/commitdiff
fix parsing of negative PIDs
authorBenedikt Böhm <bb@xnull.de>
Tue, 12 Apr 2016 19:02:28 +0000 (21:02 +0200)
committerCraig Small <csmall@enc.com.au>
Sun, 17 Apr 2016 04:59:11 +0000 (14:59 +1000)
Signed-off-by: Craig Small <csmall@enc.com.au>
skill.c

diff --git a/skill.c b/skill.c
index f8f4e499d6c6b0c75ec4849b624e1784f7620285..914752759d5e7089b6bbbaa4ac93644223994092 100644 (file)
--- a/skill.c
+++ b/skill.c
@@ -479,7 +479,7 @@ static void __attribute__ ((__noreturn__))
                        } else {
                            /* Special case for signal digit negative
                             * PIDs */
-                           pid = (long)('0' - optopt);
+                           pid = atoi(argv[optind]);
                            if (kill((pid_t)pid, signo) != 0)
                                exitvalue = EXIT_FAILURE;
                            exit(exitvalue);