summaryrefslogtreecommitdiff
path: root/libio/iofwrite.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/iofwrite.c')
-rw-r--r--libio/iofwrite.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libio/iofwrite.c b/libio/iofwrite.c
index b8f02f2dd0..0bbeef2646 100644
--- a/libio/iofwrite.c
+++ b/libio/iofwrite.c
@@ -36,7 +36,9 @@ _IO_fwrite (buf, size, count, fp)
CHECK_FILE (fp, 0);
if (request == 0)
return 0;
+ _IO_flockfile (fp);
written = _IO_sputn (fp, (const char *) buf, request);
+ _IO_funlockfile (fp);
/* Many traditional implementations return 0 if size==0 && count > 0,
but ANSI seems to require us to return count in this case. */
if (written == request)