about summary refs log tree commit diff
path: root/libio/putc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/putc.c')
-rw-r--r--libio/putc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libio/putc.c b/libio/putc.c
index b591c5538b..6e1fdeef3a 100644
--- a/libio/putc.c
+++ b/libio/putc.c
@@ -25,6 +25,8 @@ _IO_putc (int c, _IO_FILE *fp)
 {
   int result;
   CHECK_FILE (fp, EOF);
+  if (!_IO_need_lock (fp))
+    return _IO_putc_unlocked (c, fp);
   _IO_acquire_lock (fp);
   result = _IO_putc_unlocked (c, fp);
   _IO_release_lock (fp);