summaryrefslogtreecommitdiff
path: root/usr.bin/pkill/pkill.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-07-15 17:15:34 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-07-15 17:15:34 +0000
commit3b9c9b074db5b89f2a3d0c234c532bfeddeaa26b (patch)
treec9de7e0d0aa3a89cee52ed06f09a8143c61c1d94 /usr.bin/pkill/pkill.c
parent981e33d8ec0902d4189b1b94a4cb99dc67077294 (diff)
Don't print a warning if kill(2) returns ESRCH since the process may have
died on its own in the time between when the process list was consulted and when we do the actual kill. This fixes an annoyance for privsep processes (and others) where when you kill one the others die by themselves.
Diffstat (limited to 'usr.bin/pkill/pkill.c')
-rw-r--r--usr.bin/pkill/pkill.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c
index fadfdefc3b1..ed3d8142ff1 100644
--- a/usr.bin/pkill/pkill.c
+++ b/usr.bin/pkill/pkill.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pkill.c,v 1.5 2004/07/15 13:55:10 mpech Exp $ */
+/* $OpenBSD: pkill.c,v 1.6 2004/07/15 17:15:33 millert Exp $ */
/* $NetBSD: pkill.c,v 1.5 2002/10/27 11:49:34 kleink Exp $ */
/*-
@@ -38,7 +38,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: pkill.c,v 1.5 2004/07/15 13:55:10 mpech Exp $";
+static const char rcsid[] = "$OpenBSD: pkill.c,v 1.6 2004/07/15 17:15:33 millert Exp $";
#endif /* !lint */
#include <sys/types.h>
@@ -422,7 +422,7 @@ int
killact(struct kinfo_proc2 *kp)
{
- if (kill(kp->p_pid, signum) == -1) {
+ if (kill(kp->p_pid, signum) == -1 && errno != ESRCH) {
warn("signalling pid %d", (int)kp->p_pid);
return (-1);
}