X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ffputc.c;h=99532965c6894f6f52f4b37576ad6e3d2f3c4af2;hb=7650390de8f72822ec0d4a9fb5b52efcf0be4698;hp=ec859385644cc9ed219c29dbb49f85cfb0cf667b;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/stdio/fputc.c b/src/stdio/fputc.c index ec859385..99532965 100644 --- a/src/stdio/fputc.c +++ b/src/stdio/fputc.c @@ -2,9 +2,12 @@ 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); +weak_alias(fputc, _IO_putc);