From: Erik van der Kouwe Date: Fri, 18 Jun 2010 13:49:07 +0000 (+0000) Subject: Don't allow PM to sys_kill itself, this causes a race with RS calling waitpid during... X-Git-Tag: v3.1.8~440 X-Git-Url: http://zhaoyanbai.com/repos/doc/static/zlib_tech.html?a=commitdiff_plain;h=11193f5fa4423edc4316d3a0c1f0ee043170b65e;p=minix.git Don't allow PM to sys_kill itself, this causes a race with RS calling waitpid during shutdown --- diff --git a/servers/pm/signal.c b/servers/pm/signal.c index 48da05fa0..3925f885a 100644 --- a/servers/pm/signal.c +++ b/servers/pm/signal.c @@ -363,6 +363,11 @@ int ksig; /* non-zero means signal comes from kernel */ /* Handle system signals for system processes first. */ if(rmp->mp_flags & PRIV_PROC) { + /* Always skip signals for PM (only necessary when broadcasting). */ + if(rmp->mp_endpoint == PM_PROC_NR) { + return; + } + /* System signals have always to go through the kernel first to let it * pick the right signal manager. If PM is the assigned signal manager, * the signal will come back and will actually be processed. @@ -372,11 +377,6 @@ int ksig; /* non-zero means signal comes from kernel */ return; } - /* Always skip signals for PM (only necessary when broadcasting). */ - if(rmp->mp_endpoint == PM_PROC_NR) { - return; - } - /* Print stacktrace if necessary. */ if(SIGS_IS_STACKTRACE(signo)) { sys_sysctl_stacktrace(rmp->mp_endpoint);