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);