summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio/findfp.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/findfp.c')
-rw-r--r--newlib/libc/stdio/findfp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c
index 2a907bb6d..efbb62561 100644
--- a/newlib/libc/stdio/findfp.c
+++ b/newlib/libc/stdio/findfp.c
@@ -114,6 +114,10 @@ found:
fp->_ub._size = 0;
fp->_lb._base = NULL; /* no line buffer */
fp->_lb._size = 0;
+#ifndef __SINGLE_THREAD__
+ memset (&fp->_lock, 0, sizeof(fp->_lock));
+#endif
+
return fp;
}