Merge commit '4e57cf3f8c0b696f117579c8165b13c8d32b9b5d' into eclair-plus-aosp
* commit '4e57cf3f8c0b696f117579c8165b13c8d32b9b5d':
Fix an infinite loop in time2sub.
The problem is that time_t is signed, and the original code relied on the
fact that (X + c < X) in case of overflow for c >= 0. Unfortunately, this
condition is only guaranteed by the standard for unsigned arithmetic, and
the gcc 4.4.0 optimizer did completely remove the corresponding test from
the code. This resulted in a missing boundary check, and an infinite loop.
The problem is solved by testing explicitely for TIME_T_MIN and TIME_T_MAX
in the loop that uses this.
Also fix increment_overflow and long_increment_overflow which were buggy
for exactly the same reasons.
Note: a similar fix is needed for system/core/libcutils
Merge commit '9e74f697e0178a0e9b6133a2b270cc7fed9920bf' into eclair-plus-aosp
* commit '9e74f697e0178a0e9b6133a2b270cc7fed9920bf':
libc: add void to clock() function prototype
Main differences from original code:
1. now log channel for LOG_ID_MAIN may exist even if LOG_ID_RADIO
facility failed.
2. __write_to_log_null() now acts as always successful function.
3. it's more simplier to add new logging channels now
ammended commit fixes my typo on line 130
Merge commit '3773d35eb98e22b5edab4d82fb72bdf86ff80494'
* commit '3773d35eb98e22b5edab4d82fb72bdf86ff80494':
Make the DNS resolver accept domain names with an underscore.
More precisely, this accepts domain labels with an underscore in
the middle (i.e. not at the start or the end of the label). This
is needed to perform complex CNAME chain resolution in certain
VPN networks.
Some libc changes were preventing the initialization call from being made.
The basic problem appears to be that libc_init_common.c is only built once,
and it's only built for the non-debug libc.
Merge commit 'ef0bd1857041ffde069cf52138aaf22c1af7130e'
* commit 'ef0bd1857041ffde069cf52138aaf22c1af7130e':
Pass the elfdata pointer in a slot of the temporary TLS area.
This allows libc.so to run the C runtime initializer as soon as the
dynamic linker loads the shared library, i.e. before any other initializers
(e.g. static C++ constructors in other shared libraries the executable depends
on).
This also removes the bug where the initializers from the executable itself
were run twice: once by the dynamic linker, and another time by __libc_init
as defined by libc_init_dynamic.c
This is needed to properly initialize the C runtime when libc.so
is loaded by the dynamic linker.
Move the temporary TLS setup before the first system call, just
in case something really horrible happens, we won't crash when
trying to write an error code in 'errno'
Remove the broken TLS_SLOT_THREAD_ID setup. First, this slot
should normally receive the address of a pthread_internal_t,
not a kernel thread identifier. Second, it is never used by
the linker anyway.
Also remove an obsolete comment.
Merge commit 'c4eee3765bf9dd81ff055e70ff7daa83a3926d2a'
* commit 'c4eee3765bf9dd81ff055e70ff7daa83a3926d2a':
Prevent a crash in the memory leak checker (which happened in chk_free())
Simplify the code a little, removing un-necessary mutex locks/unlocks.
Provide slightly better diagnostic message in case of corruption.
Use snprintf/strlcat instead of sprintf/strcat
Merge commit '09baf4e881c78e67c7849aa81432ceb34e72e913'
* commit '09baf4e881c78e67c7849aa81432ceb34e72e913':
Add Glibc-compatible macro aliases for the nanosecond time accessors in stat structure