summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-06-30 14:46:37 +0300
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-06-30 18:28:07 +0200
commitaa67771881d65373da448ad5f7a8393f3a1d9469 (patch)
tree27014872fb65cc839b352ac7ddb55c9e674d7dfd /libc
parent8b48f745be1e086d6e486bbb8167e770f3d1fbc5 (diff)
more workarounds for GCC PR32219
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>
Diffstat (limited to 'libc')
-rw-r--r--libc/misc/internals/__uClibc_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 3f09ad228..58f6643b2 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -447,11 +447,11 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,
* 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__