From e0d29a5578252806a0b88fc92f5f839fc2d4fa42 Mon Sep 17 00:00:00 2001 From: jdolecek Date: Sat, 30 Nov 2002 09:54:43 +0000 Subject: [PATCH] fix bug in previous - if child was traced and p_opptr == p_pptr, need to reparent the process to initproc, so that child wouldn't have its p_pptr pointer still pointing on the exited parent pointed out by Dave Sainty in private mail (the patch in kern/14443 didn't have this bug) --- sys/kern/kern_exit.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 953096f5a3b4..0f2676087eca 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exit.c,v 1.104 2002/11/28 21:41:29 jdolecek Exp $ */ +/* $NetBSD: kern_exit.c,v 1.105 2002/11/30 09:54:43 jdolecek Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -78,7 +78,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.104 2002/11/28 21:41:29 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.105 2002/11/30 09:54:43 jdolecek Exp $"); #include "opt_ktrace.h" #include "opt_perfctrs.h" @@ -273,7 +273,8 @@ exit1(struct proc *p, int rv) struct proc *t = q->p_opptr; proc_reparent(q, t ? t : initproc); q->p_opptr = NULL; - } + } else + proc_reparent(q, initproc); q->p_flag &= ~(P_TRACED|P_WAITED|P_FSTRACE); psignal(q, SIGKILL); } else {