+ if (p->p_pptr->p_flag & P_NOCLDWAIT) {
+ struct proc * pp = p->p_pptr;
+
+ proc_reparent(p, initproc);
+ /* If there are no more children wakeup parent */
+ if (LIST_EMPTY(&pp->p_children))
+ wakeup((caddr_t)pp);
+ }
+ /* should be fine as parent proc would be initproc */
+ pp = p->p_pptr;
+ if (pp != initproc) {
+ pp->si_pid = p->p_pid;
+ pp->si_status = p->p_xstat;
+ pp->si_code = CLD_EXITED;
+ pp->si_uid = p->p_cred->p_ruid;
+ }
+ psignal(pp, SIGCHLD);
+