diff options
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r-- | sys/kern/kern_lock.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index a40ee24d847..1da1663f8d0 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_lock.c,v 1.9 1999/07/09 15:17:59 art Exp $ */ +/* $OpenBSD: kern_lock.c,v 1.10 2001/11/07 02:44:10 art Exp $ */ /* * Copyright (c) 1995 @@ -318,8 +318,13 @@ lockmgr(lkp, flags, interlkp, p) /* * Recursive lock. */ - if ((extflags & LK_CANRECURSE) == 0) + if ((extflags & LK_CANRECURSE) == 0) { + if (extflags & LK_RECURSEFAIL) { + error = EDEADLK; + break; + } panic("lockmgr: locking against myself"); + } lkp->lk_exclusivecount++; COUNT(p, 1); break; |