summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/internals/__uClibc_main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index fd4e9552b..ffe8ad813 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -13,10 +13,7 @@
#define _ERRNO_H
#include <stdlib.h>
#include <unistd.h>
-//#include <errno.h>
-#undef errno
-#define __set_errno(val) (*__errno_location ()) = (val)
/*
* Prototypes.
@@ -80,7 +77,8 @@ void __uClibc_main(int argc, char **argv, char **envp)
* have resulted in errno being set nonzero, so set it to 0 before
* we call main.
*/
- __set_errno(0);
+ if (__errno_location)
+ *(__errno_location()) = 0;
/*
* Finally, invoke application's main and then exit.