diff --git a/servers/pm/forkexit.c b/servers/pm/forkexit.c index 6dfd86f13..1d748c93e 100644 --- a/servers/pm/forkexit.c +++ b/servers/pm/forkexit.c @@ -48,7 +48,7 @@ PUBLIC int do_fork() 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); } @@ -146,6 +146,9 @@ int exit_status; /* the process' exit status (for parent) */ 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. */ @@ -161,7 +164,7 @@ int exit_status; /* the process' exit status (for parent) */ 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); diff --git a/servers/pm/main.c b/servers/pm/main.c index 9f214a4a4..a65bc1b98 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -74,10 +74,8 @@ PUBLIC void main() * 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; diff --git a/servers/pm/misc.c b/servers/pm/misc.c index fa18427cc..3376a44e6 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -75,6 +75,7 @@ PUBLIC int do_reboot() * 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 */ } /*=====================================================================*