Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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 62ce98fb7..78758ce93 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;
}