aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-10-31 00:30:48 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-10-31 00:30:48 +0000
commitb9b344aa44ba6221edc8f09398325399049bf388 (patch)
tree0fb8f61e9ec11b39c0fc8e9d9358ca33d5b9c1b4 /procps
parentf34cfff2f032ff8e475c97f69ea49a24f94b64f5 (diff)
downloadbusybox-b9b344aa44ba6221edc8f09398325399049bf388.tar.gz
kill[all[5]]: accept -s SIG too. kill_main: +29 bytes
by Steve Bennett (steveb AT workware.net.au)
Diffstat (limited to 'procps')
-rw-r--r--procps/kill.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/procps/kill.c b/procps/kill.c
index ed659afdc..140550018 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -96,10 +96,14 @@ int kill_main(int argc, char **argv)
if (arg[0] != '-') goto do_it_now;
}
- /* -SIG */
- signo = get_signum(&arg[1]);
+ arg++; /* skip '-' */
+ if (argc > 1 && arg[0] == 's' && arg[1] == '\0') { /* -s SIG? */
+ argc--;
+ arg = *++argv;
+ } /* else it must be -SIG */
+ signo = get_signum(arg);
if (signo < 0) { /* || signo > MAX_SIGNUM ? */
- bb_error_msg("bad signal name '%s'", &arg[1]);
+ bb_error_msg("bad signal name '%s'", arg);
return EXIT_FAILURE;
}
arg = *++argv;