summaryrefslogtreecommitdiffstats
path: root/newlib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/stdio/fflush.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/newlib/libc/stdio/fflush.c b/newlib/libc/stdio/fflush.c
index 218940dcf..bc208ec49 100644
--- a/newlib/libc/stdio/fflush.c
+++ b/newlib/libc/stdio/fflush.c
@@ -93,6 +93,9 @@ _DEFUN(_fflush_r, (ptr, fp),
CHECK_INIT (ptr, fp);
+ if (!fp->_flags)
+ return 0;
+
_flockfile (fp);
t = fp->_flags;