summaryrefslogtreecommitdiff
path: root/src/stdio/fputc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/fputc.c')
-rw-r--r--src/stdio/fputc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stdio/fputc.c b/src/stdio/fputc.c
index 98d0a20a..6a144a54 100644
--- a/src/stdio/fputc.c
+++ b/src/stdio/fputc.c
@@ -2,9 +2,10 @@
int fputc(int c, FILE *f)
{
- FLOCK(f);
+ if (f->lock < 0 || !__lockfile(f))
+ return putc_unlocked(c, f);
c = putc_unlocked(c, f);
- FUNLOCK(f);
+ __unlockfile(f);
return c;
}