summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/_flock_stub.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2001-02-23 17:55:01 +0000
committergreen <green@FreeBSD.org>2001-02-23 17:55:01 +0000
commit77bc7b795e45635f615e846f46ab6439adb17700 (patch)
tree59401d41c02df95dff629cef364cfbd4cbc6022f /lib/libc/stdio/_flock_stub.c
parent575ee59b1c3162f7917e5e0b3fdacb39c4b96039 (diff)
downloadFreeBSD-src-77bc7b795e45635f615e846f46ab6439adb17700.zip
FreeBSD-src-77bc7b795e45635f615e846f46ab6439adb17700.tar.gz
Correctly handle the race itself, too (don't leave it locked).
This is about to be replaced anyway by initialization explicitly instead of lazily, and reducing the complexity of it. As it is now, this will work fine, however.
Diffstat (limited to 'lib/libc/stdio/_flock_stub.c')
-rw-r--r--lib/libc/stdio/_flock_stub.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libc/stdio/_flock_stub.c b/lib/libc/stdio/_flock_stub.c
index 0d34e57..7d17f9a 100644
--- a/lib/libc/stdio/_flock_stub.c
+++ b/lib/libc/stdio/_flock_stub.c
@@ -99,6 +99,7 @@ init_lock(FILE *fp)
}
if (fp->_lock != NULL) { /* lost the race */
free(p);
+ _pthread_mutex_unlock(&init_lock_mutex);
return (0);
}
fp->_lock = p;
OpenPOWER on IntegriCloud