X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstdio%2Ffputc.c;h=6a144a5429f682fc5b79329cb309d28fc2a528e1;hp=ec859385644cc9ed219c29dbb49f85cfb0cf667b;hb=dba68bf98fc708cea4c478278c889fc7ad802b00;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01 diff --git a/src/stdio/fputc.c b/src/stdio/fputc.c index ec859385..6a144a54 100644 --- a/src/stdio/fputc.c +++ b/src/stdio/fputc.c @@ -2,9 +2,11 @@ int fputc(int c, FILE *f) { - FLOCK(f); - if (c != f->lbf && f->wpos + 1 < f->wend) *f->wpos++ = c; - else c = __overflow(f, c); - FUNLOCK(f); + if (f->lock < 0 || !__lockfile(f)) + return putc_unlocked(c, f); + c = putc_unlocked(c, f); + __unlockfile(f); return c; } + +weak_alias(fputc, putc);