Commit
2e53dd645d5348f207cec7f8595969dc566c5a55 workarounds GCC
bug when accessing _locale_init and _stdio_init. We need the same
fix for __errno_location and __h_errno_location otherwise we crash
calling null with static and non-threaded builds.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* have resulted in errno being set nonzero, so set it to 0 before
* we call main.
*/
- if (likely(__errno_location!=NULL))
+ if (likely(not_null_ptr(__errno_location)))
*(__errno_location()) = 0;
/* Set h_errno to 0 as well */
- if (likely(__h_errno_location!=NULL))
+ if (likely(not_null_ptr(__h_errno_location)))
*(__h_errno_location()) = 0;
#if defined HAVE_CLEANUP_JMP_BUF && defined __UCLIBC_HAS_THREADS_NATIVE__