OSDN Git Service

Fix flockfile(3) and friends for stdin/stdout/stderr too.
authorElliott Hughes <enh@google.com>
Wed, 19 Nov 2014 23:16:51 +0000 (15:16 -0800)
committerElliott Hughes <enh@google.com>
Wed, 19 Nov 2014 23:16:51 +0000 (15:16 -0800)
commitc48c3e4bb3d1665f3e9fa2785daafa72dfe59399
tree9a77515a49315acd7b7441349d5157597f2f76d8
parent27aa9c5b50cc3e979fc67c1bf5296dfd725c8540
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
libc/bionic/flockfile.cpp
libc/stdio/fileext.h
libc/stdio/glue.h
libc/stdio/local.h
libc/stdio/wcio.h