summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-03-17 18:26:52 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-03-17 18:26:52 +0000
commitc6d8f293827d335bc986e05272323b21d05fc770 (patch)
tree375236d87d35e74455539a82383f8e17c9ed6d57 /sys
parentd863494f2eef286fa4fd05c4d84915aad925de96 (diff)
Add a DIAGNOSTIC check for when both LK_CANRECURSE and
LK_RECURSEFAIL are set.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_lock.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index e21182ba649..b35d8f25c23 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_lock.c,v 1.12 2002/03/14 01:27:04 millert Exp $ */
+/* $OpenBSD: kern_lock.c,v 1.13 2002/03/17 18:26:51 art Exp $ */
/*
* Copyright (c) 1995
@@ -205,6 +205,13 @@ lockmgr(lkp, flags, interlkp, p)
if ((flags & LK_REENABLE) == 0)
lkp->lk_flags |= LK_DRAINED;
}
+
+ /*
+ * Check if the caller is asking us to be schizophrenic.
+ */
+ if ((lkp->lk_flags & (LK_CANRECURSE|LK_RECURSEFAIL)) ==
+ (LK_CANRECURSE|LK_RECURSEFAIL))
+ panic("lockmgr: make up your mind");
#endif /* DIAGNOSTIC */
switch (flags & LK_TYPE_MASK) {