Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/kern Pull up following revision(s) (requested by chri...



details:   https://anonhg.NetBSD.org/src/rev/308591acc5b4
branches:  netbsd-6
changeset: 774347:308591acc5b4
user:      riz <riz%NetBSD.org@localhost>
date:      Sat Jul 21 00:00:13 2012 +0000

description:
Pull up following revision(s) (requested by christos in ticket #430):
        sys/kern/sys_sig.c: revision 1.38
>From Roger Pau Monne: kill(2) called for a zombie process should return 0,
according to:
    http://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html

diffstat:

 sys/kern/sys_sig.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r 83cb12747846 -r 308591acc5b4 sys/kern/sys_sig.c
--- a/sys/kern/sys_sig.c        Fri Jul 20 23:57:38 2012 +0000
+++ b/sys/kern/sys_sig.c        Sat Jul 21 00:00:13 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_sig.c,v 1.36 2011/11/18 03:34:13 christos Exp $    */
+/*     $NetBSD: sys_sig.c,v 1.36.6.1 2012/07/21 00:00:13 riz Exp $     */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.36 2011/11/18 03:34:13 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.36.6.1 2012/07/21 00:00:13 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -242,10 +242,11 @@
        if (pid > 0) {
                /* kill single process */
                mutex_enter(proc_lock);
-               p = proc_find(pid);
-               if (p == NULL) {
+               p = proc_find_raw(pid);
+               if (p == NULL || (p->p_stat != SACTIVE && p->p_stat != SSTOP)) {
                        mutex_exit(proc_lock);
-                       return ESRCH;
+                       /* IEEE Std 1003.1-2001: return success for zombies */
+                       return p ? 0 : ESRCH;
                }
                mutex_enter(p->p_lock);
                error = kauth_authorize_process(l->l_cred,



Home | Main Index | Thread Index | Old Index