- if (((p->p_flag&P_SYSTEM) == 0) && (p->p_pptr->p_pid != 0) && (p != self)) {
- if (p->p_sigcatch & sigmask(SIGTERM))
+ if (((p->p_flag&P_SYSTEM) == 0) && (p->p_pptr->p_pid != 0) && (p != self) && (p->p_shutdownstate == 0)) {
+ if (p->p_sigcatch & sigmask(SIGTERM)) {
+ p->p_shutdownstate = 1;
IOSleep(200); /* double the time from 100 to 200 for NFS requests in particular */
for (p = allproc.lh_first; p; p = p->p_list.le_next) {
IOSleep(200); /* double the time from 100 to 200 for NFS requests in particular */
for (p = allproc.lh_first; p; p = p->p_list.le_next) {
/* Wait for the reaper thread to run, and clean up what we have done
* before we proceed with the hardcore shutdown. This reduces the race
* between kill_tasks and the reaper thread.
/* Wait for the reaper thread to run, and clean up what we have done
* before we proceed with the hardcore shutdown. This reduces the race
* between kill_tasks and the reaper thread.