Fix flockfile(3) and friends for stdin/stdout/stderr too.

stdin/stdout/stderr are special; their mutexes are initialized by
__sinit. There's no unit test for this, because __sinit has already
been called by the time the first unit test runs, but you could
reproduce this failure with a trivial main() that calls flockfile
or ftrylockfile on one of the standard streams before otherwise
using stdio.

Bug: 18208568
Change-Id: I28d232cf05a9f198a2bed61854d8047b23d2091d
This commit is contained in:
Elliott Hughes
2014-11-19 15:16:51 -08:00
parent 27aa9c5b50
commit c48c3e4bb3
5 changed files with 32 additions and 0 deletions

View File

@@ -32,6 +32,10 @@
#ifndef _WCIO_H_
#define _WCIO_H_
#include <sys/cdefs.h>
__BEGIN_DECLS
/* minimal requirement of SUSv2 */
#define WCIO_UNGETWC_BUFSIZE 1
@@ -78,4 +82,6 @@ do {\
#define WCIO_INIT(fp) \
memset(&(_EXT(fp)->_wcio), 0, sizeof(struct wchar_io_data))
__END_DECLS
#endif /*_WCIO_H_*/