summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2008-09-05 14:17:51 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2008-09-05 14:17:51 +0000
commit7f686eeee2f24b08dd27f76649b28e5c3a7ad05f (patch)
tree4883cd6df29de0ae93353d3077c0aa18497aab80 /sys/kern
parent8e2f8ec20a09aee6ae42c6e3549bf366e0ae955b (diff)
Don't overwrite the old ipl in msleep if PNORELOCK was set.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_synch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 529ad02fb5a..332ae51cf98 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_synch.c,v 1.84 2008/09/05 14:11:57 oga Exp $ */
+/* $OpenBSD: kern_synch.c,v 1.85 2008/09/05 14:17:50 art Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*
@@ -164,10 +164,10 @@ msleep(void *ident, struct mutex *mtx, int priority, const char *wmesg, int tim
error1 = sleep_finish_timeout(&sls);
error = sleep_finish_signal(&sls);
- if (mtx && (priority & PNORELOCK) == 0)
+ if (mtx && (priority & PNORELOCK) == 0) {
mtx_enter(mtx);
-
- MUTEX_OLDIPL(mtx) = spl; /* put the ipl back else it breaks things */
+ MUTEX_OLDIPL(mtx) = spl; /* put the ipl back */
+ }
/* Signal errors are higher priority than timeouts. */
if (error == 0 && error1 != 0)
error = error1;