diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-02-26 09:35:50 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-02-26 09:35:50 +0000 |
commit | 033c0d7edcb04845b31ca09ae87f9c25acab975d (patch) | |
tree | 363dc134e08512eb9ae8e40b75ef86cda828baa6 /libc/misc/internals/__uClibc_main.c | |
parent | 2c81c415ceda41331df567ba97ab5cdf98211107 (diff) |
Proper support for setting h_errno
Diffstat (limited to 'libc/misc/internals/__uClibc_main.c')
-rw-r--r-- | libc/misc/internals/__uClibc_main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index ffe8ad813..7f5e6e805 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -30,11 +30,13 @@ void __uClibc_main(int argc, char **argv, char **envp) weak_alias(__environ, environ); extern void weak_function __init_stdio(void); extern void weak_function __stdio_flush_buffers(void); -extern int *weak_function __errno_location (void); +extern int *weak_const_function __errno_location (void); +extern int *weak_const_function __h_errno_location (void); #else extern void __init_stdio(void); extern void __stdio_flush_buffers(void); extern int *__errno_location (void); +extern int *__h_errno_location (void); #endif /* @@ -79,6 +81,9 @@ void __uClibc_main(int argc, char **argv, char **envp) */ if (__errno_location) *(__errno_location()) = 0; + /* Set h_errno to 0 as well */ + if (__h_errno_location) + *(__h_errno_location()) = 0; /* * Finally, invoke application's main and then exit. |