From: Craig Small Date: Sun, 20 May 2018 10:42:12 +0000 (+1000) Subject: killall: Fix -INT option parsing X-Git-Tag: v23.2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf80d701397d2ff705ab1c1250e3906f32034539;p=psmisc killall: Fix -INT option parsing Sometimes killall gets confused between a signal name and a set of options. This small patch should un-confuse it. --- diff --git a/ChangeLog b/ChangeLog index 5c7cc6b..087c947 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ Changes in 23.2 =============== * killall: look at all namespaces by default + * killall: Fix -INT option parsing #11 Changes in 23.1 =============== * killall: Remove debug output Debian: #864753 diff --git a/src/killall.c b/src/killall.c index 7bb9313..5fee135 100644 --- a/src/killall.c +++ b/src/killall.c @@ -803,6 +803,7 @@ main (int argc, char **argv) int sig_num; int optc; int myoptind; + int skip_error=0; struct passwd *pwent = NULL; char yt[16]; char ot[16]; @@ -911,6 +912,7 @@ main (int argc, char **argv) ignore_case = 1; } else { sig_num = get_signal (argv[optind]+1, "killall"); + skip_error=1; } break; case 'V': @@ -948,7 +950,10 @@ main (int argc, char **argv) if (argv[optind-1][1] >= '0' && argv[optind-1][1] <= '9') { sig_num = atoi(argv[optind-1]+1); } else { - usage(NULL); + if (skip_error) + skip_error=0; + else + usage(NULL); } } break;