if ((procs_in_use == NR_PROCS) ||
(procs_in_use >= NR_PROCS-LAST_FEW && rmp->mp_effuid != 0))
{
- printf("PM: proc table full!\n");
+ printf("PM: warning, process table is full!\n");
return(EAGAIN);
}
tell_fs(EXIT, proc_nr, 0, 0); /* file system can free the proc slot */
sys_xit(rmp->mp_parent, proc_nr);
+ /* Pending reply messages for the dead process cannot be delivered. */
+ rmp->mp_flags &= ~REPLY;
+
/* Release the memory occupied by the child. */
if (find_share(rmp, rmp->mp_ino, rmp->mp_dev, rmp->mp_ctime) == NULL) {
/* No other process shares the text segment, so free it. */
p_mp = &mproc[rmp->mp_parent]; /* process' parent */
pidarg = p_mp->mp_wpid; /* who's being waited for? */
parent_waiting = p_mp->mp_flags & WAITING;
-
+
right_child = /* child meets one of the 3 tests? */
(pidarg == -1 || pidarg == rmp->mp_pid || -pidarg == rmp->mp_procgrp);
* the call just made above. The processes must not be swapped out.
*/
for (proc_nr=0, rmp=mproc; proc_nr < NR_PROCS; proc_nr++, rmp++) {
- if ((rmp->mp_flags & IN_USE) &&
- (rmp->mp_flags & (REPLY | ONSWAP)) == REPLY) {
+ if ((rmp->mp_flags & (REPLY | ONSWAP)) == REPLY) {
if ((s=send(proc_nr, &rmp->mp_reply)) != OK) {
- printf("Warning, PM send failed: %d, ", s);
panic("PM can't reply to", proc_nr);
}
rmp->mp_flags &= ~REPLY;
* get a HARD_STOP notification. Await the notification in the main loop.
*/
sys_abort(m_in.reboot_flag, PM_PROC_NR, monitor_code, m_in.reboot_size);
+ return(SUSPEND); /* don't reply to killed process */
}
/*=====================================================================*