fix parsing of negative PIDs

Signed-off-by: Craig Small <csmall@enc.com.au>
This commit is contained in:
Benedikt Böhm 2016-04-12 21:02:28 +02:00 committed by Craig Small
parent aa9bd38d0a
commit b42997b6c9

View File

@ -479,7 +479,7 @@ static void __attribute__ ((__noreturn__))
} else { } else {
/* Special case for signal digit negative /* Special case for signal digit negative
* PIDs */ * PIDs */
pid = (long)('0' - optopt); pid = atoi(argv[optind]);
if (kill((pid_t)pid, signo) != 0) if (kill((pid_t)pid, signo) != 0)
exitvalue = EXIT_FAILURE; exitvalue = EXIT_FAILURE;
exit(exitvalue); exit(exitvalue);