aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 29016ca380a2..5027182875d5 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -543,6 +543,11 @@ exit1(struct thread *td, int rval, int signo)
*/
while ((q = LIST_FIRST(&p->p_orphans)) != NULL) {
PROC_LOCK(q);
+ KASSERT(q->p_oppid == p->p_pid,
+ ("orphan %p of %p has unexpected oppid %d", q, p,
+ q->p_oppid));
+ q->p_oppid = q->p_reaper->p_pid;
+
/*
* If we are the real parent of this process
* but it has been reparented to a debugger, then