From: Ben Gras Date: Thu, 8 Sep 2005 14:31:23 +0000 (+0000) Subject: Added shutdown_started global variable. If it's set, we're in the X-Git-Tag: v3.1.0~151 X-Git-Url: http://zhaoyanbai.com/repos/ddns-confgen.html?a=commitdiff_plain;h=c655d8b3aed7e9a8ffaa06c0c323d6b3cf5d243b;p=minix.git Added shutdown_started global variable. If it's set, we're in the process of doing a shutdown. Initial purpose is - suppress dead process diagnostic message. --- diff --git a/kernel/glo.h b/kernel/glo.h index 7e5d76813..bbc3e8383 100755 --- a/kernel/glo.h +++ b/kernel/glo.h @@ -16,6 +16,7 @@ /* Variables relating to shutting down MINIX. */ EXTERN char kernel_exception; /* TRUE after system exceptions */ +EXTERN char shutdown_started; /* TRUE after shutdowns / reboots */ /* Kernel information structures. This groups vital kernel information. */ EXTERN phys_bytes aout; /* address of a.out headers */ diff --git a/kernel/main.c b/kernel/main.c index 641e63351..5dbc25467 100755 --- a/kernel/main.c +++ b/kernel/main.c @@ -155,6 +155,9 @@ PUBLIC void main() } #endif + /* We're definitely not shutting down. */ + shutdown_started = 0; + /* MINIX is now ready. All boot image processes are on the ready queue. * Return to the assembly code to start running the current process. */ @@ -213,6 +216,9 @@ int how; send_sig(proc_nr(rp), SIGKSTOP); } + /* We're shutting down. Diagnostics may behave differently now. */ + shutdown_started = 1; + /* Notify system processes of the upcoming shutdown and allow them to be * scheduled by setting a watchog timer that calls shutdown(). The timer * argument passes the shutdown status. diff --git a/kernel/proc.c b/kernel/proc.c index 3b49c67f1..8165dc33d 100755 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -149,8 +149,8 @@ message *m_ptr; /* pointer to message in the caller's space */ return(ECALLDENIED); /* call denied by ipc mask */ } - if (isemptyn(src_dst)) { - kprintf("[sys_call: dead dest; %d, %d, %d] ", + if (isemptyn(src_dst) && !shutdown_started) { + kprintf("sys_call: dead dest; %d, %d, %d\n", function, proc_nr(caller_ptr), src_dst); return(EDEADDST); /* cannot send to the dead */ }