diff options
Diffstat (limited to 'newlib/libc/stdio/fwrite.c')
-rw-r--r-- | newlib/libc/stdio/fwrite.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/newlib/libc/stdio/fwrite.c b/newlib/libc/stdio/fwrite.c index 642fb27..1c91632 100644 --- a/newlib/libc/stdio/fwrite.c +++ b/newlib/libc/stdio/fwrite.c @@ -98,7 +98,12 @@ _DEFUN (fwrite, (buf, size, count, fp), * generally slow and since this occurs whenever size==0. */ + _flockfile(fp); if (__sfvwrite (fp, &uio) == 0) - return count; + { + _funlockfile(fp); + return count; + } + _funlockfile(fp); return (n - uio.uio_resid) / size; } |