[uClibc-cvs] uClibc/libc/stdlib atexit.c,1.25,1.26
Manuel Novoa III
mjn3 at uclibc.org
Sat Dec 27 23:36:25 UTC 2003
Update of /var/cvs/uClibc/libc/stdlib
In directory nail:/tmp/cvs-serv11959/libc/stdlib
Modified Files:
atexit.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: atexit.c
===================================================================
RCS file: /var/cvs/uClibc/libc/stdlib/atexit.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- atexit.c 27 Dec 2003 23:30:43 -0000 1.25
+++ atexit.c 27 Dec 2003 23:36:23 -0000 1.26
@@ -218,6 +218,10 @@
pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
#endif
+#ifdef __UCLIBC_CTOR_DTOR__
+extern void (*__app_fini)(void);
+#endif
+
/*
* Normal program termination
*/
@@ -230,6 +234,11 @@
}
UNLOCK;
+#ifdef __UCLIBC_CTOR_DTOR__
+ if (__app_fini != NULL)
+ (__app_fini)();
+#endif
+
/* If we are using stdio, try to shut it down. At the very least,
* this will attempt to commit all buffered writes. It may also
* unbuffer all writable files, or close them outright.
More information about the uClibc-cvs
mailing list