about summary refs log tree commit diff
path: root/libio/iofread.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/iofread.c')
-rw-r--r--libio/iofread.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libio/iofread.c b/libio/iofread.c
index babe2c54cc..bad94ca17b 100644
--- a/libio/iofread.c
+++ b/libio/iofread.c
@@ -36,7 +36,9 @@ _IO_fread (buf, size, count, fp)
   CHECK_FILE (fp, 0);
   if (bytes_requested == 0)
     return 0;
+  _IO_flockfile (fp);
   bytes_read = _IO_sgetn (fp, (char *) buf, bytes_requested);
+  _IO_funlockfile (fp);
   return bytes_requested == bytes_read ? count : bytes_read / size;
 }
 weak_alias (_IO_fread, fread)