kill: print usage if no pid is passed in command line
Modication of master line patch 27b2937
Signed-off-by: Craig Small <csmall@enc.com.au>
This commit is contained in:
parent
6586f9f9ce
commit
8d6466a48d
3
kill.c
3
kill.c
@ -125,6 +125,9 @@ int main(int argc, char **argv)
|
|||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
|
if (argc < 1)
|
||||||
|
print_usage(stderr);
|
||||||
|
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
pid = strtol_or_err(argv[i], _("failed to parse argument"));
|
pid = strtol_or_err(argv[i], _("failed to parse argument"));
|
||||||
if (!kill((pid_t) pid, signo))
|
if (!kill((pid_t) pid, signo))
|
||||||
|
Loading…
Reference in New Issue
Block a user