diff options
Diffstat (limited to 'libc/stdio/_fopen.c')
-rw-r--r-- | libc/stdio/_fopen.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libc/stdio/_fopen.c b/libc/stdio/_fopen.c index f7f5bb626..b1722fef2 100644 --- a/libc/stdio/_fopen.c +++ b/libc/stdio/_fopen.c @@ -98,8 +98,12 @@ FILE *_stdio_fopen(intptr_t fname_or_mode, #ifdef __UCLIBC_HAS_THREADS__ /* We only initialize the mutex in the non-freopen case. */ /* stream->__user_locking = _stdio_user_locking; */ +#ifdef __UCLIBC_HAS_FUTEXES__ + _IO_lock_init (stream->_lock); +#else __stdio_init_mutex(&stream->__lock); #endif +#endif } #ifdef __UCLIBC_MJN3_ONLY__ @@ -190,8 +194,12 @@ FILE *_stdio_fopen(intptr_t fname_or_mode, #ifdef __UCLIBC_HAS_THREADS__ /* Even in the freopen case, we reset the user locking flag. */ stream->__user_locking = _stdio_user_locking; +#ifdef __UCLIBC_HAS_FUTEXES__ + /* _IO_lock_init (stream->_lock); */ +#else /* __stdio_init_mutex(&stream->__lock); */ #endif +#endif #ifdef __STDIO_HAS_OPENLIST __STDIO_THREADLOCK_OPENLIST; |