X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ffgetc.c;h=4d8aca371d895603653e1d06ca53c2a1f2ce726a;hb=bf9d9dcaa631db9918452d05c188f01c8e5f537f;hp=3a7f1e304850f46c5076577750126eb8fe20354d;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/stdio/fgetc.c b/src/stdio/fgetc.c index 3a7f1e30..4d8aca37 100644 --- a/src/stdio/fgetc.c +++ b/src/stdio/fgetc.c @@ -3,8 +3,11 @@ int fgetc(FILE *f) { int c; - FLOCK(f); - c = f->rpos < f->rstop ? *f->rpos++ : __uflow(f); - FUNLOCK(f); + if (f->lock < 0 || !__lockfile(f)) + return getc_unlocked(f); + c = getc_unlocked(f); + __unlockfile(f); return c; } + +weak_alias(fgetc, getc);