diff options
| author | Mateusz Guzik <mjg@FreeBSD.org> | 2013-06-30 20:27:31 +0000 |
|---|---|---|
| committer | Mateusz Guzik <mjg@FreeBSD.org> | 2013-06-30 20:27:31 +0000 |
| commit | 214e08782bc71b5a9a5e997274e25acbb60764fc (patch) | |
| tree | 4cc73e8595d8b21596ba1a120dfe4f755922cc37 /usr.bin | |
| parent | 71c80b4ea071059edf13925f93bac517b581d3c6 (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/killall/killall.1 | 4 | ||||
| -rw-r--r-- | usr.bin/killall/killall.c | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/killall/killall.1 b/usr.bin/killall/killall.1 index 7beaadb56fd43..be813f78c46e6 100644 --- a/usr.bin/killall/killall.1 +++ b/usr.bin/killall/killall.1 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2012 +.Dd June 30, 2013 .Dt KILLALL 1 .Os .Sh NAME @@ -110,6 +110,8 @@ the specified Limit potentially matching processes to those matching the specified .Ar procname . +.It Fl q +Suppress error message if no processes are matched. .It Fl z Do not skip zombies. This should not have any effect except to print a few error messages diff --git a/usr.bin/killall/killall.c b/usr.bin/killall/killall.c index 83e829ac1c6fa..dd22a83e6f22c 100644 --- a/usr.bin/killall/killall.c +++ b/usr.bin/killall/killall.c @@ -53,7 +53,7 @@ static void __dead2 usage(void) { - fprintf(stderr, "usage: killall [-delmsvz] [-help] [-I] [-j jail]\n"); + fprintf(stderr, "usage: killall [-delmsqvz] [-help] [-I] [-j jail]\n"); fprintf(stderr, " [-u user] [-t tty] [-c cmd] [-SIGNAL] [cmd]...\n"); fprintf(stderr, "At least one option or argument to specify processes must be given.\n"); @@ -101,6 +101,7 @@ main(int ac, char **av) char *user = NULL; char *tty = NULL; char *cmd = NULL; + int qflag = 0; int vflag = 0; int sflag = 0; int dflag = 0; @@ -191,6 +192,9 @@ main(int ac, char **av) errx(1, "must specify procname"); cmd = *av; break; + case 'q': + qflag++; + break; case 'v': vflag++; break; @@ -417,8 +421,9 @@ main(int ac, char **av) } } if (killed == 0) { - fprintf(stderr, "No matching processes %swere found\n", - getuid() != 0 ? "belonging to you " : ""); + if (!qflag) + fprintf(stderr, "No matching processes %swere found\n", + getuid() != 0 ? "belonging to you " : ""); errors = 1; } exit(errors); |
