X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ffputc.c;h=92762c98f8ccf28312140d0df717441483e15e79;hb=6d861ac87491a207e4599c44b61d142f0a601c2d;hp=ec859385644cc9ed219c29dbb49f85cfb0cf667b;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/stdio/fputc.c b/src/stdio/fputc.c index ec859385..92762c98 100644 --- a/src/stdio/fputc.c +++ b/src/stdio/fputc.c @@ -2,9 +2,9 @@ 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; }