diff options
author | csjp <csjp@FreeBSD.org> | 2014-01-17 03:30:24 +0000 |
---|---|---|
committer | csjp <csjp@FreeBSD.org> | 2014-01-17 03:30:24 +0000 |
commit | 0728e663d0c574d0fe21026527eb2bd27388371c (patch) | |
tree | c0f7714e5a6858db959d689b8a5eea1927946252 /usr.bin | |
parent | 61b11742063d9db90d9b8107dbe80caa02b25f1e (diff) | |
download | FreeBSD-src-0728e663d0c574d0fe21026527eb2bd27388371c.zip FreeBSD-src-0728e663d0c574d0fe21026527eb2bd27388371c.tar.gz |
fix a regression introduced in r237618 that would result in
killall confusing killall -INT with killall -I (interactive
confirmation) which resulted in the wrong signal (TERM)
being delivered to the process(s).
Discussed with: delphij
MFC after: 2 weeks
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/killall/killall.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/killall/killall.c b/usr.bin/killall/killall.c index dd22a83..13dc556 100644 --- a/usr.bin/killall/killall.c +++ b/usr.bin/killall/killall.c @@ -144,9 +144,6 @@ main(int ac, char **av) if (**av == '-') { ++*av; switch (**av) { - case 'I': - Iflag = 1; - break; case 'j': ++*av; if (**av == '\0') { @@ -213,6 +210,15 @@ 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: if (isalpha((unsigned char)**av)) { if (strncasecmp(*av, "SIG", 3) == 0) |