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