From 5ce7dc9543896883a3e30a1e6676c9f4c215f382 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Mon, 18 Feb 2002 08:50:08 +0000 Subject: 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... --- libc/stdlib/atexit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libc/stdlib') diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c index d7be35fbd..af739d52b 100644 --- a/libc/stdlib/atexit.c +++ b/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); } -- cgit v1.2.3