diff options
-rw-r--r-- | libfshelp/lock-acquire.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libfshelp/lock-acquire.c b/libfshelp/lock-acquire.c index 42e75dd0..3d8df550 100644 --- a/libfshelp/lock-acquire.c +++ b/libfshelp/lock-acquire.c @@ -42,9 +42,11 @@ fshelp_acquire_lock (struct lock_box *box, int *user, struct mutex *mut, if (flags & LOCK_UN) { if (*user & LOCK_UN) - return EBADF; + return 0; + assert (*user == box->type); assert (*user == LOCK_SH || *user == LOCK_EX); + if (*user == LOCK_SH) { if (!--box->shcount) |