X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ffgetc.c;h=65a10fa61777b164daab818595c53cf496e7194c;hb=d62f4e98881702f07501b965e5beebd7516deca2;hp=da6386842f99fc869d244f3c0b9e71c3465910ef;hpb=e3cd6c5c265cd481db6e0c5b529855d99f0bda30;p=musl diff --git a/src/stdio/fgetc.c b/src/stdio/fgetc.c index da638684..65a10fa6 100644 --- a/src/stdio/fgetc.c +++ b/src/stdio/fgetc.c @@ -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);