fix dlsym RTLD_NEXT support
[oweals/musl.git] / src / stdio / fgetc.c
index da6386842f99fc869d244f3c0b9e71c3465910ef..65a10fa61777b164daab818595c53cf496e7194c 100644 (file)
@@ -3,10 +3,12 @@
 int fgetc(FILE *f)
 {
        int c;
-       FLOCK(f);
+       if (f->lock < 0 || !__lockfile(f))
+               return getc_unlocked(f);
        c = getc_unlocked(f);
-       FUNLOCK(f);
+       __unlockfile(f);
        return c;
 }
 
 weak_alias(fgetc, getc);
+weak_alias(fgetc, _IO_getc);