Fix flockfile(3) and friends for stdin/stdout/stderr too.
Elliott Hughes authored
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

(cherry picked from commit c48c3e4b)

Change-Id: Ia0c43ed4ac69daea8152aee9516415a6e3f8a042
432f6458
Name Last commit Last update
NetdClient.cpp
NetdClientDispatch.cpp
__FD_chk.cpp
__cmsg_nxthdr.cpp
__cxa_guard.cpp
__cxa_pure_virtual.cpp
__errno.cpp
__fgets_chk.cpp
__libc_current_sigrtmax.cpp
__libc_current_sigrtmin.cpp
__memcpy_chk.cpp
__memmove_chk.cpp
__memset_chk.cpp
__read_chk.cpp
__recvfrom_chk.cpp
__set_errno.cpp
__stack_chk_fail.cpp
__stpcpy_chk.cpp
__stpncpy_chk.cpp
__strcat_chk.cpp
__strchr_chk.cpp
__strcpy_chk.cpp
__strlcat_chk.cpp
__strlcpy_chk.cpp
__strlen_chk.cpp
__strncat_chk.cpp
__strncpy_chk.cpp
__strrchr_chk.cpp
__umask_chk.cpp
__vsnprintf_chk.cpp
__vsprintf_chk.cpp
abort.cpp
accept.cpp
accept4.cpp
access.cpp
assert.cpp
atof.cpp
bindresvport.c
bionic_time_conversions.cpp
brk.cpp
c16rtomb.cpp
c32rtomb.cpp
chmod.cpp
chown.cpp
clearenv.cpp
clock.cpp
clone.cpp
connect.cpp
crtbrand.c
ctype.cpp
daemon.c
debug_mapinfo.cpp
debug_mapinfo.h
debug_stacktrace.cpp
debug_stacktrace.h
dirent.cpp
dl_iterate_phdr_static.cpp
dlmalloc.c
dlmalloc.h
dup2.cpp
epoll_create.cpp
epoll_pwait.cpp
epoll_wait.cpp
err.c
ether_aton.c
ether_ntoa.c
eventfd_read.cpp
eventfd_write.cpp
ffs.cpp
flockfile.cpp
fork.cpp
fpclassify.cpp
fts.c
futimens.cpp
getauxval.cpp
getcwd.cpp
getentropy_linux.c
gethostname.c
getpgrp.cpp
getpid.cpp
getpriority.c
gettid.cpp
hash.h
if_indextoname.c
if_nametoindex.c
initgroups.c
inotify_init.cpp
ioctl.c
isatty.c
jemalloc.h
jemalloc_wrapper.cpp
lchown.cpp
legacy_32_bit_support.cpp
lfs64_support.cpp
libc_init_common.cpp
libc_init_common.h
libc_init_dynamic.cpp
libc_init_static.cpp
libc_logging.cpp
libgen.cpp