projects
/
oweals
/
musl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix indention with spaces in powerpc asm
[oweals/musl.git]
/
src
/
stdio
/
flockfile.c
diff --git
a/src/stdio/flockfile.c
b/src/stdio/flockfile.c
index 1b6ef5806fb78818139a509f116664ac96f0cdb8..a196c1efe0af11663f5e0537a0de1db02c3982ef 100644
(file)
--- a/
src/stdio/flockfile.c
+++ b/
src/stdio/flockfile.c
@@
-3,7
+3,8
@@
void flockfile(FILE *f)
{
- pthread_self();
- libc.lockfile = __lockfile;
- __lockfile(f);
+ while (ftrylockfile(f)) {
+ int owner = f->lock;
+ if (owner) __wait(&f->lock, &f->waiters, owner, 1);
+ }
}