aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdio/fputs.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/fputs.c')
-rw-r--r--newlib/libc/stdio/fputs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/newlib/libc/stdio/fputs.c b/newlib/libc/stdio/fputs.c
index 62ce98f..78758ce 100644
--- a/newlib/libc/stdio/fputs.c
+++ b/newlib/libc/stdio/fputs.c
@@ -60,6 +60,7 @@ _DEFUN (fputs, (s, fp),
char _CONST * s _AND
FILE * fp)
{
+ int result;
struct __suio uio;
struct __siov iov;
@@ -67,5 +68,8 @@ _DEFUN (fputs, (s, fp),
iov.iov_len = uio.uio_resid = strlen (s);
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
- return __sfvwrite (fp, &uio);
+ _flockfile(fp);
+ result = __sfvwrite (fp, &uio);
+ _funlockfile(fp);
+ return result;
}