[uClibc-cvs] uClibc/libc/misc/internals __uClibc_main.c,1.28,1.29

Manuel Novoa III mjn3 at uclibc.org
Sat Dec 27 23:36:25 UTC 2003


Update of /var/cvs/uClibc/libc/misc/internals
In directory nail:/tmp/cvs-serv11959/libc/misc/internals

Modified Files:
	__uClibc_main.c 
Log Message:
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.


Index: __uClibc_main.c
===================================================================
RCS file: /var/cvs/uClibc/libc/misc/internals/__uClibc_main.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- __uClibc_main.c	30 Jun 2003 21:47:29 -0000	1.28
+++ __uClibc_main.c	27 Dec 2003 23:36:22 -0000	1.29
@@ -101,6 +101,9 @@
 
 }
 
+#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 @@
 
 #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) {




More information about the uClibc-cvs mailing list