summaryrefslogtreecommitdiff
path: root/proc
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-07-03 18:43:51 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-07-03 18:43:51 +0000
commite1cf8027cf8a7ec532c5ca87775a2ddc9038bc81 (patch)
tree141082b2d24fde9e19883825088ff3a019e32b8d /proc
parent38eae2b44ee0e71d7f36fdd9d34c5cfacbdf5184 (diff)
(process_has_exited): When reparenting children to init, if one of
them is dead, alert init.
Diffstat (limited to 'proc')
-rw-r--r--proc/mgt.c6
1 files changed, 6 insertions, 0 deletions
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