correct locking in stdio functions that tried to be lock-free
[musl] / src / stdio / feof.c
index 5d7f4b0..56da6b9 100644 (file)
@@ -4,7 +4,10 @@
 
 int feof(FILE *f)
 {
-       return !!(f->flags & F_EOF);
+       FLOCK(f);
+       int ret = !!(f->flags & F_EOF);
+       FUNLOCK(f);
+       return ret;
 }
 
 weak_alias(feof, feof_unlocked);