summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/newlibc_exit.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-05-27 16:47:13 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-05-27 16:47:13 +0000
commit83734c9d521ddadfabb9589da9574436fdf45f4a (patch)
tree845c1fe4db50e7e8a5454ca7dcf0aeba3210f439 /cpukit/libcsupport/src/newlibc_exit.c
parent2008-05-27 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-83734c9d521ddadfabb9589da9574436fdf45f4a.tar.bz2
2008-05-27 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/newlibc_exit.c, score/src/threadhandler.c: Call fini() as part of exit(). This avoids atexit() being a required function.
Diffstat (limited to 'cpukit/libcsupport/src/newlibc_exit.c')
-rw-r--r--cpukit/libcsupport/src/newlibc_exit.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/cpukit/libcsupport/src/newlibc_exit.c b/cpukit/libcsupport/src/newlibc_exit.c
index cff0146cbb..735f5752d1 100644
--- a/cpukit/libcsupport/src/newlibc_exit.c
+++ b/cpukit/libcsupport/src/newlibc_exit.c
@@ -120,8 +120,16 @@ void libc_wrapup(void)
#include <unistd.h>
#if !defined(RTEMS_UNIX)
-void _exit(int status)
+ #define EXIT_SYMBOL _exit
+#else
+ #define EXIT_SYMBOL exit
+#endif
+
+void EXIT_SYMBOL(int status)
{
+ extern void _fini( void );
+ _fini();
+
/*
* We need to do the exit processing on the global reentrancy structure.
* This has already been done on the per task reentrancy structure
@@ -133,14 +141,5 @@ void _exit(int status)
for (;;) ; /* to avoid warnings */
}
-#else
-
-void exit(int status)
-{
- libc_wrapup();
- rtems_shutdown_executive(status);
- for (;;) ; /* to avoid warnings */
-}
-#endif
#endif