diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-09 19:52:13 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-09 19:52:13 +0000 |
commit | 023509e8e5f1ad1f6a61cdec061d43e69a16ebc3 (patch) | |
tree | 1a96bfe648b08ccd9359bfcca8c13bcfd05a0938 | |
parent | 36ac7bee0f6b0be35eafd74e0fc865edd2352197 (diff) |
Remove vestigial locking init from sprintf routines.
-rw-r--r-- | libc/stdio/vdprintf.c | 2 | ||||
-rw-r--r-- | libc/stdio/vsnprintf.c | 9 | ||||
-rw-r--r-- | libc/stdio/vswprintf.c | 4 |
3 files changed, 3 insertions, 12 deletions
diff --git a/libc/stdio/vdprintf.c b/libc/stdio/vdprintf.c index 9e1b22eaf..2105313e7 100644 --- a/libc/stdio/vdprintf.c +++ b/libc/stdio/vdprintf.c @@ -47,6 +47,8 @@ int vdprintf(int filedes, const char * __restrict format, va_list arg) __INIT_MBSTATE(&(f.__state)); #endif /* __STDIO_MBSTATE */ +/* _vfprintf_internal doesn't do any locking, locking init is here + * only because of fflush_unlocked. TODO? */ #ifdef __UCLIBC_HAS_THREADS__ f.__user_locking = 1; /* Set user locking. */ __stdio_init_mutex(&f.__lock); diff --git a/libc/stdio/vsnprintf.c b/libc/stdio/vsnprintf.c index 4eef2c1a0..132959dcf 100644 --- a/libc/stdio/vsnprintf.c +++ b/libc/stdio/vsnprintf.c @@ -41,16 +41,13 @@ int vsnprintf(char *__restrict buf, size_t size, __INIT_MBSTATE(&(f.__state)); #endif /* __STDIO_MBSTATE */ -#ifdef __UCLIBC_HAS_THREADS__ - f.__user_locking = 1; /* Set user locking. */ - __stdio_init_mutex(&f.__lock); -#endif f.__nextopen = NULL; if (size > SIZE_MAX - (size_t) buf) { size = SIZE_MAX - (size_t) buf; } +/* TODO: this comment seems to be wrong */ /* Set these last since __bufputc initialization depends on * __user_locking and only gets set if user locking is on. */ f.__bufstart = (unsigned char *) buf; @@ -195,10 +192,6 @@ int vsnprintf(char *__restrict buf, size_t size, __INIT_MBSTATE(&(f.__state)); #endif /* __STDIO_MBSTATE */ -#ifdef __UCLIBC_HAS_THREADS__ - f.__user_locking = 1; /* Set user locking. */ - __stdio_init_mutex(&f.__lock); -#endif f.__nextopen = NULL; rv = _vfprintf_internal(&f, format, arg); diff --git a/libc/stdio/vswprintf.c b/libc/stdio/vswprintf.c index 919ac2132..f80bb5f64 100644 --- a/libc/stdio/vswprintf.c +++ b/libc/stdio/vswprintf.c @@ -38,10 +38,6 @@ int vswprintf(wchar_t *__restrict buf, size_t size, __INIT_MBSTATE(&(f.__state)); #endif /* __STDIO_MBSTATE */ -#ifdef __UCLIBC_HAS_THREADS__ - f.__user_locking = 1; /* Set user locking. */ - __stdio_init_mutex(&f.__lock); -#endif f.__nextopen = NULL; if (size > ((SIZE_MAX - (size_t) buf)/sizeof(wchar_t))) { |