diff options
Diffstat (limited to 'libc/stdio/stdio.cpp')
-rw-r--r-- | libc/stdio/stdio.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libc/stdio/stdio.cpp b/libc/stdio/stdio.cpp index d6275569c..d3ac0436e 100644 --- a/libc/stdio/stdio.cpp +++ b/libc/stdio/stdio.cpp @@ -170,7 +170,10 @@ found: fp->_lb._base = nullptr; /* no line buffer */ fp->_lb._size = 0; - _FILEEXT_INIT(fp); + + memset(_EXT(fp), 0, sizeof(struct __sfileext)); + _FLOCK(fp) = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; + _EXT(fp)->_caller_handles_locking = false; // Caller sets cookie, _read/_write etc. // We explicitly clear _seek and _seek64 to prevent subtle bugs. |