Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Currently, if a process is exiting and its parent h...



details:   https://anonhg.NetBSD.org/src/rev/971a7faae3a2
branches:  trunk
changeset: 340949:971a7faae3a2
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Oct 13 00:27:19 2015 +0000

description:
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.

This change causes both old and new parents to be properly updated.

Fixes PR kern/50300

Pullups will be requested for:

       NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2

diffstat:

 sys/kern/kern_exit.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f5820a508dbf -r 971a7faae3a2 sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c      Tue Oct 13 00:25:51 2015 +0000
+++ b/sys/kern/kern_exit.c      Tue Oct 13 00:27:19 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exit.c,v 1.245 2015/10/02 16:54:15 christos Exp $ */
+/*     $NetBSD: kern_exit.c,v 1.246 2015/10/13 00:27:19 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.245 2015/10/02 16:54:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.246 2015/10/13 00:27:19 pgoyette Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_dtrace.h"
@@ -959,7 +959,7 @@
        if (child->p_pptr == parent)
                return;
 
-       if (child->p_stat == SZOMB ||
+       if (child->p_stat == SZOMB || child->p_stat == SDEAD ||
            (child->p_stat == SSTOP && !child->p_waited)) {
                child->p_pptr->p_nstopchild--;
                parent->p_nstopchild++;



Home | Main Index | Thread Index | Old Index