summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2008-11-06 22:11:37 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2008-11-06 22:11:37 +0000
commit8a3d593d83934938cf8a587690e9a0600aa7202c (patch)
treeb08d7d2bb7caec838e7b030cdd8b59347cc23765 /sys/kern
parent0a4376d78e0e202b27c65d29f5a0399458bfd7e9 (diff)
Some paranoia and deconfusion.
- setrunnable should never be run on SIDL processes. That's a bug and will cause all kinds of trouble. Change the switch statement to panic if that happens. - p->p_stat == SRUN implies that p != curproc since curproc will always be SONPROC. This is a leftover from before SONPROC. deraadt@ "commit"
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sched_bsd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/kern/sched_bsd.c b/sys/kern/sched_bsd.c
index 0de34540858..e5db94d2aaa 100644
--- a/sys/kern/sched_bsd.c
+++ b/sys/kern/sched_bsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sched_bsd.c,v 1.18 2008/09/10 14:01:23 blambert Exp $ */
+/* $OpenBSD: sched_bsd.c,v 1.19 2008/11/06 22:11:36 art Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*-
@@ -256,8 +256,7 @@ schedcpu(void *arg)
p->p_estcpu = newcpu;
resetpriority(p);
if (p->p_priority >= PUSER) {
- if ((p != curproc) &&
- p->p_stat == SRUN &&
+ if (p->p_stat == SRUN &&
(p->p_priority / PPQ) != (p->p_usrpri / PPQ)) {
remrunqueue(p);
p->p_priority = p->p_usrpri;
@@ -500,6 +499,7 @@ setrunnable(struct proc *p)
case SONPROC:
case SZOMB:
case SDEAD:
+ case SIDL:
default:
panic("setrunnable");
case SSTOP:
@@ -512,8 +512,6 @@ setrunnable(struct proc *p)
case SSLEEP:
unsleep(p); /* e.g. when sending signals */
break;
- case SIDL:
- break;
}
p->p_stat = SRUN;
setrunqueue(p);