Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/usr.bin/pkill Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/dea4b6ce8066
branches:  netbsd-3
changeset: 577360:dea4b6ce8066
user:      riz <riz%NetBSD.org@localhost>
date:      Sat Oct 15 16:34:24 2005 +0000

description:
Pull up following revision(s) (requested by kleink in ticket #890):
        usr.bin/pkill/pkill.c: revision 1.15
Downgrade failure to kill(2) (other than ESRCH) from fatal error to a
warning; otherwise processing aborts and possibly matching killees would
remain unsignalled.  This makes pkill match the Solaris behavior.

diffstat:

 usr.bin/pkill/pkill.c |  19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diffs (42 lines):

diff -r 3f0e58119f50 -r dea4b6ce8066 usr.bin/pkill/pkill.c
--- a/usr.bin/pkill/pkill.c     Sat Oct 15 16:34:04 2005 +0000
+++ b/usr.bin/pkill/pkill.c     Sat Oct 15 16:34:24 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pkill.c,v 1.9.2.5 2005/10/15 16:34:04 riz Exp $        */
+/*     $NetBSD: pkill.c,v 1.9.2.6 2005/10/15 16:34:24 riz Exp $        */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: pkill.c,v 1.9.2.5 2005/10/15 16:34:04 riz Exp $");
+__RCSID("$NetBSD: pkill.c,v 1.9.2.6 2005/10/15 16:34:24 riz Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -437,14 +437,17 @@
                /*
                 * Check for ESRCH, which indicates that the process
                 * disappeared between us matching it and us
-                * signalling it.  Return 0 to indicate that the
-                * process should not be considered a match, since we
-                * didn't actually get to signal it.
+                * signalling it; don't issue a warning about it.
                 */
-               if (errno == ESRCH)
-                       return 0;
+               if (errno != ESRCH)
+                       warn("signalling pid %d", (int)kp->p_pid);
 
-               err(STATUS_ERROR, "signalling pid %d", (int)kp->p_pid);
+               /*
+                * Return 0 to indicate that the process should not be
+                * considered a match, since we didn't actually get to
+                * signal it.
+                */
+               return 0;
        }
 
        return 1;



Home | Main Index | Thread Index | Old Index