major stdio overhaul, using readv/writev, plus other changes
[musl] / src / stdio / flockfile.c
index 1b6ef58..440a36a 100644 (file)
@@ -3,7 +3,9 @@
 
 void flockfile(FILE *f)
 {
-       pthread_self();
-       libc.lockfile = __lockfile;
+       if (!libc.lockfile) {
+               pthread_self();
+               libc.lockfile = __lockfile;
+       }
        __lockfile(f);
 }