Browse Source

Miles Bader writes:
Programs that don't use stdio crash in the `exit' function, because
they call through the pointer__uClibc_cleanup, which has a value of 0.
It has a value of 0 because __uClibc_main.c initializes it to the
address of `__stdio_close_all', which is a weak symbol (and so is 0 if
stdio is not used).
This patch from Miles fixes it, though we need to audit
__stdio_close_all usage to be sure...

Eric Andersen 23 years ago
parent
commit
5ce7dc9543
1 changed files with 2 additions and 1 deletions
  1. 2 1
      libc/stdlib/atexit.c

+ 2 - 1
libc/stdlib/atexit.c

@@ -159,7 +159,8 @@ void exit(int rv)
 	}
 
 	/* Clean up everything else */
-	__uClibc_cleanup();
+	if (__uClibc_cleanup) {
+	    __uClibc_cleanup();
 
 	_exit(rv);
 }