diff options
Diffstat (limited to 'libc/stdio/scanf.c')
-rw-r--r-- | libc/stdio/scanf.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c index 0bb6c0f4d..13254a50b 100644 --- a/libc/stdio/scanf.c +++ b/libc/stdio/scanf.c @@ -235,8 +235,12 @@ int vsscanf(__const char *sp, __const char *fmt, va_list ap) #ifdef __UCLIBC_HAS_THREADS__ f.__user_locking = 1; /* Set user locking. */ +#ifdef __UCLIBC_HAS_FUTEXES__ + _IO_lock_init (f._lock); +#else __stdio_init_mutex(&f.__lock); #endif +#endif f.__nextopen = NULL; /* Set these last since __bufgetc initialization depends on @@ -282,8 +286,12 @@ int vsscanf(__const char *sp, __const char *fmt, va_list ap) #ifdef __UCLIBC_HAS_THREADS__ f.f.__user_locking = 1; /* Set user locking. */ +#ifdef __UCLIBC_HAS_FUTEXES__ + _IO_lock_init (f.f._lock); +#else __stdio_init_mutex(&f.f.__lock); #endif +#endif f.f.__nextopen = NULL; return vfscanf(&f.f, fmt, ap); @@ -413,8 +421,12 @@ int vswscanf(const wchar_t * __restrict str, const wchar_t * __restrict format, #ifdef __UCLIBC_HAS_THREADS__ f.__user_locking = 1; /* Set user locking. */ +#ifdef __UCLIBC_HAS_FUTEXES__ + _IO_lock_init (f._lock); +#else __stdio_init_mutex(&f.__lock); #endif +#endif f.__nextopen = NULL; return vfwscanf(&f, format, arg); |