summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2003-12-27 23:36:23 +0000
committerManuel Novoa III <mjn3@codepoet.org>2003-12-27 23:36:23 +0000
commite919981c95644082a0ea16f0bed7af04664a6c89 (patch)
tree5c93212d98db87997dc84ab1ce4d1bc07e4b4972 /libc/misc
parentd05dafe2fc23137f8decd641d82d23f45e16281c (diff)
Handle the app_fini stuff in exit without requiring atexit().
This avoids pulling in all the malloc/free code for a simple true/false app.
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/internals/__uClibc_main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 1940832d4..5f85b5928 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -101,6 +101,9 @@ void __uClibc_init(void)
}
+#ifdef __UCLIBC_CTOR_DTOR__
+void (*__app_fini)(void) = NULL;
+#endif
/* __uClibc_start_main is the new main stub for uClibc. This function is
* called from crt0 (version 0.9.16 or newer), after ALL shared libraries
@@ -128,9 +131,7 @@ __uClibc_start_main(int argc, char **argv, char **envp,
#ifdef __UCLIBC_CTOR_DTOR__
/* Arrange for the application's dtors to run before we exit. */
- if (app_fini!=NULL) {
- atexit(app_fini);
- }
+ __app_fini = app_fini;
/* Run all the application's ctors now. */
if (app_init!=NULL) {