Browse Source

Miles Bader noticed that I'd messed up by always pulling
errno in, regardless of whether it is being used...
-Erik

Eric Andersen 23 years ago
parent
commit
df237488ed
1 changed files with 2 additions and 4 deletions
  1. 2 4
      libc/misc/internals/__uClibc_main.c

+ 2 - 4
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.