diff --git a/usr.bin/killall/killall.c b/usr.bin/killall/killall.c index 13dc55688cd3..b171630d6b9b 100644 --- a/usr.bin/killall/killall.c +++ b/usr.bin/killall/killall.c @@ -90,6 +90,7 @@ nosig(char *name) int main(int ac, char **av) { + char **saved_av; struct kinfo_proc *procs, *newprocs; struct stat sb; struct passwd *pw; @@ -210,16 +211,8 @@ main(int ac, char **av) case 'z': zflag++; break; - case 'I': - /* - * NB: do not confuse -INT with -I - */ - if (strncmp(*av, "INT", 3) != 0) { - Iflag = 1; - break; - } - /* FALLTHROUGH */ default: + saved_av = av; if (isalpha((unsigned char)**av)) { if (strncasecmp(*av, "SIG", 3) == 0) *av += 3; @@ -229,8 +222,14 @@ main(int ac, char **av) sig = p - sys_signame; break; } - if (!sig) - nosig(*av); + if (!sig) { + if (**saved_av == 'I') { + av = saved_av; + Iflag = 1; + break; + } else + nosig(*av); + } } else if (isdigit((unsigned char)**av)) { sig = strtol(*av, &ep, 10); if (!*av || *ep)