summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-10-14 01:56:34 +0000
committerMiles Bader <miles@gnu.org>1996-10-14 01:56:34 +0000
commit84d2ccf910e6ccafe0ec2f94ac5fd42fc737cc15 (patch)
treea488a308054fc2e36021e2de017a900883521a84
parentd0ccc990c8d647b7b839608d57e8b1127122a642 (diff)
(fshelp_acquire_lock):
Return success, not EBADF, when unlocking a file which we don't haved locked; this is netbsd's behavior.
-rw-r--r--libfshelp/lock-acquire.c4
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)