Fixed PM send() failed warning: don't reply to killed process that did reboot.

:  `VS: Enter Log.  Lines beginning with `CVS:' are removed automatically
This commit is contained in:
Jorrit Herder 2005-05-30 09:29:48 +00:00
parent ed54b1cd6a
commit 9646824fce
3 changed files with 7 additions and 5 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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 */
}
/*=====================================================================*