From e1cf8027cf8a7ec532c5ca87775a2ddc9038bc81 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Wed, 3 Jul 1996 18:43:51 +0000 Subject: (process_has_exited): When reparenting children to init, if one of them is dead, alert init. --- proc/mgt.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'proc/mgt.c') diff --git a/proc/mgt.c b/proc/mgt.c index 8a2bfe4e..fb58899d 100644 --- a/proc/mgt.c +++ b/proc/mgt.c @@ -665,6 +665,7 @@ process_has_exited (struct proc *p) if (p->p_ochild) { struct proc *tp; /* will point to the last one */ + int isdead = 0; /* first tell them their parent is changing */ for (tp = p->p_ochild; tp->p_sib; tp = tp->p_sib) @@ -674,6 +675,8 @@ process_has_exited (struct proc *p) 1, tp->p_pgrp->pg_pgid, !tp->p_pgrp->pg_orphcnt); tp->p_parent = startup_proc; + if (tp->p_dead) + isdead = 1; } if (tp->p_msgport != MACH_PORT_NULL) nowait_msg_proc_newids (tp->p_msgport, tp->p_task, @@ -687,6 +690,9 @@ process_has_exited (struct proc *p) tp->p_sib->p_prevsib = &tp->p_sib; startup_proc->p_ochild = p->p_ochild; p->p_ochild->p_prevsib = &startup_proc->p_ochild; + + if (isdead) + alert_parent (startup_proc); } /* If an operation is in progress for this process, cause it -- cgit v1.2.3