From e8cdac9bfd025c2ff5fb551e9086b19ee719ff26 Mon Sep 17 00:00:00 2001 From: David Greenman Date: Mon, 12 Dec 1994 06:04:27 +0000 Subject: [PATCH] Don't mess with already freed structures when a process is being run down. --- sys/kern/kern_synch.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 72b710fdbd9..f3724ff9779 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_synch.c 8.6 (Berkeley) 1/21/94 - * $Id: kern_synch.c,v 1.7 1994/10/02 17:35:18 phk Exp $ + * $Id: kern_synch.c,v 1.8 1994/10/18 06:55:39 davidg Exp $ */ #include @@ -574,19 +574,21 @@ mi_switch() * If over max, kill it. In any case, if it has run for more * than 10 minutes, reduce priority to give others a chance. */ - rlim = &p->p_rlimit[RLIMIT_CPU]; - if (s >= rlim->rlim_cur) { - if (s >= rlim->rlim_max) - psignal(p, SIGKILL); - else { - psignal(p, SIGXCPU); - if (rlim->rlim_cur < rlim->rlim_max) - rlim->rlim_cur += 5; + if (p->p_stat != SZOMB) { + rlim = &p->p_rlimit[RLIMIT_CPU]; + if (s >= rlim->rlim_cur) { + if (s >= rlim->rlim_max) + psignal(p, SIGKILL); + else { + psignal(p, SIGXCPU); + if (rlim->rlim_cur < rlim->rlim_max) + rlim->rlim_cur += 5; + } + } + if (s > 10 * 60 && p->p_ucred->cr_uid && p->p_nice == NZERO) { + p->p_nice = NZERO + 4; + resetpriority(p); } - } - if (s > 10 * 60 && p->p_ucred->cr_uid && p->p_nice == NZERO) { - p->p_nice = NZERO + 4; - resetpriority(p); } /*