rmp->mp_parent = INIT_PROC_NR;
parent_waiting = mproc[INIT_PROC_NR].mp_flags & WAITING;
if (parent_waiting && (rmp->mp_flags & ZOMBIE) &&
+ !(rmp->mp_flags & TOLD_PARENT) &&
rmp->mp_fs_call != PM_EXIT) {
cleanup(rmp);
}
/* The value of pidarg determines which children qualify. */
if (pidarg > 0 && pidarg != rp->mp_pid) continue;
if (pidarg < -1 && -pidarg != rp->mp_procgrp) continue;
+ if (rp->mp_flags & TOLD_PARENT) continue; /* post-ZOMBIE */
children++; /* this child is acceptable */
if (rp->mp_flags & ZOMBIE) {
mp_parent= child->mp_parent;
if (mp_parent <= 0)
panic(__FILE__, "tell_parent: bad value in mp_parent", mp_parent);
+ if(child->mp_flags & TOLD_PARENT)
+ panic(__FILE__, "tell_parent: telling parent again", NO_NUM);
parent = &mproc[mp_parent];
/* Wake up the parent by sending the reply message. */
parent->mp_reply.reply_res2 = exitstatus;
setreply(child->mp_parent, child->mp_pid);
parent->mp_flags &= ~WAITING; /* parent no longer waiting */
- child->mp_flags &= ~ZOMBIE; /* avoid informing parent twice */
+ child->mp_flags |= TOLD_PARENT; /* avoid informing parent twice */
}
/*===========================================================================*
/* Clean up if the parent has collected the exit
* status
*/
- if (!(rmp->mp_flags & ZOMBIE))
+ if (rmp->mp_flags & TOLD_PARENT)
real_cleanup(rmp);
break;
/* Clean up if the parent has collected the exit
* status
*/
- if (!(rmp->mp_flags & ZOMBIE))
+ if (rmp->mp_flags & TOLD_PARENT)
real_cleanup(rmp);
break;
#define PRIV_PROC 0x2000 /* system process, special privileges */
#define PM_SIG_PENDING 0x4000 /* process got a signal while waiting for FS */
#define PARTIAL_EXEC 0x8000 /* Process got a new map but no content */
+#define TOLD_PARENT 0x10000 /* Parent wait() completed, ZOMBIE off */
#define NIL_MPROC ((struct mproc *) 0)
#endif
sigflags = rmp->mp_sigact[signo].sa_flags;
if (sigismember(&rmp->mp_catch, signo)) {
+ /* Stop process from running before we do stack calculations. */
+ sys_nice(rmp->mp_endpoint, PRIO_STOP);
if (rmp->mp_flags & SIGSUSPENDED)
rmp->mp_sigmsg.sm_mask = rmp->mp_sigmask2;
else