]> granicus.if.org Git - procps-ng/commitdiff
kill for PID -1 restored
authorCraig Small <csmall@enc.com.au>
Tue, 28 Jan 2014 11:35:26 +0000 (22:35 +1100)
committerCraig Small <csmall@enc.com.au>
Tue, 28 Jan 2014 11:35:26 +0000 (22:35 +1100)
Both the man page and the shell builtin kill mention you can
use PID -1, which means nuke everything you can get at.
Alas this "fun" option was missing and the only way to get
around it was with "kill -HUP -- -1".

This small change means kill -HUP -1 is back for all those
destructive types. The error was introduced when the argument
parser was fixed for other problems.

Thanks to Mike for pointing this out.

Signed-off-by: Craig Small <csmall@enc.com.au>
skill.c

diff --git a/skill.c b/skill.c
index 5c8192a6606d76dc60e7e8563be12691c3529558..1c99985b8332ddf156dc1032695fe10851e81635 100644 (file)
--- a/skill.c
+++ b/skill.c
@@ -477,6 +477,12 @@ static void __attribute__ ((__noreturn__))
                        display_kill_version();
                        exit(EXIT_SUCCESS);
                case '?':
+                       /* Special case is -1 which means all except init */
+                       if (optopt == '1') {
+                           if (kill(-1, signo) != 0)
+                               exitvalue = EXIT_FAILURE;
+                           exit(exitvalue);
+                       }
                        if (!isdigit(optopt)) {
                                xwarnx(_("invalid argument %c"), optopt);
                                kill_usage(stderr);