X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstdio%2Fflockfile.c;h=8e2206514c67db4bd05aef79484ad110a07170ed;hb=6c858d6fd4df8b5498ef2cae66c8f3c3eff1587b;hp=0d4c92c24d9de3793f28870b60020b8bd5001d99;hpb=9080cc153cc2b09881c3245becbd68534db18d7c;p=musl diff --git a/src/stdio/flockfile.c b/src/stdio/flockfile.c index 0d4c92c2..8e220651 100644 --- a/src/stdio/flockfile.c +++ b/src/stdio/flockfile.c @@ -3,6 +3,7 @@ void flockfile(FILE *f) { - if (!libc.threaded) pthread_self(); + if (!ftrylockfile(f)) return; __lockfile(f); + __register_locked_file(f, __pthread_self()); }