summaryrefslogtreecommitdiff
path: root/skill.c
diff options
context:
space:
mode:
authorCraig Small <csmall@enc.com.au>2014-01-28 22:35:26 +1100
committerCraig Small <csmall@enc.com.au>2014-01-28 22:35:26 +1100
commit4359cf069819d9fb53493933e00d9af5c37bced5 (patch)
tree74e6225b53bb825e4a95b64bc2b2e83e67acebc0 /skill.c
parentae9676a337e38526b994d189444f3fd02ab800ad (diff)
downloadprocps-ng-4359cf069819d9fb53493933e00d9af5c37bced5.tar.gz
kill for PID -1 restored
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>
Diffstat (limited to 'skill.c')
-rw-r--r--skill.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/skill.c b/skill.c
index 5c8192a..1c99985 100644
--- 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);