kill[all[5]]: accept -s SIG too. kill_main: +29 bytes

by Steve Bennett (steveb AT workware.net.au)
This commit is contained in:
Denis Vlasenko
2008-10-31 00:30:48 +00:00
parent f34cfff2f0
commit b9b344aa44
2 changed files with 15 additions and 8 deletions

View File

@@ -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;