fix remaining direct use of stat syscalls outside fstatat.c
[musl] / src / stdio / flockfile.c
index 0d4c92c..8e22065 100644 (file)
@@ -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());
 }