X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Fflockfile.c;h=8e2206514c67db4bd05aef79484ad110a07170ed;hb=e95538fa07d2b460b25ee6c2fef05f820888776d;hp=1b6ef5806fb78818139a509f116664ac96f0cdb8;hpb=5eb0d33ec0f08b123c5c10877d6258d05fa9453a;p=musl diff --git a/src/stdio/flockfile.c b/src/stdio/flockfile.c index 1b6ef580..8e220651 100644 --- a/src/stdio/flockfile.c +++ b/src/stdio/flockfile.c @@ -3,7 +3,7 @@ void flockfile(FILE *f) { - pthread_self(); - libc.lockfile = __lockfile; + if (!ftrylockfile(f)) return; __lockfile(f); + __register_locked_file(f, __pthread_self()); }