summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r--sys/kern/kern_lock.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index 77a883c1c8f..c87cb9a3a51 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_lock.c,v 1.41 2013/05/01 17:18:55 tedu Exp $ */
+/* $OpenBSD: kern_lock.c,v 1.42 2013/05/06 16:37:55 tedu Exp $ */
/*
* Copyright (c) 1995
@@ -61,7 +61,15 @@ lockinit(struct lock *lkp, int prio, char *wmesg, int timo, int flags)
int
lockstatus(struct lock *lkp)
{
- return (rrw_status(&lkp->lk_lck));
+ switch (rrw_status(&lkp->lk_lck)) {
+ case RW_WRITE:
+ return (LK_EXCLUSIVE);
+ case RW_READ:
+ return (LK_SHARED);
+ case 0:
+ default:
+ return (0);
+ }
}
int