]> Git Repo - uclibc-ng.git/commitdiff
Miles Bader writes:
authorEric Andersen <[email protected]>
Mon, 18 Feb 2002 08:50:08 +0000 (08:50 -0000)
committerEric Andersen <[email protected]>
Mon, 18 Feb 2002 08:50:08 +0000 (08:50 -0000)
    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...

libc/stdlib/atexit.c

index d7be35fbd4541b9f09f06d6905ff4ceaf277203a..af739d52b9f43296e949bdd940f9042c0bbdf5ee 100644 (file)
@@ -159,7 +159,8 @@ void exit(int rv)
        }
 
        /* Clean up everything else */
-       __uClibc_cleanup();
+       if (__uClibc_cleanup) {
+           __uClibc_cleanup();
 
        _exit(rv);
 }
This page took 0.028753 seconds and 4 git commands to generate.