diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-04-24 15:04:30 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-04-26 10:57:08 +0200 |
commit | b7cf1ff7174377c65816908be427e1a76a5fa20f (patch) | |
tree | 13fb6a245c53df77b5e4559d809c7984559156ef /cpukit/libcsupport/src/newlibc_exit.c | |
parent | libcsupport: Rename open_dev_console() (diff) | |
download | rtems-b7cf1ff7174377c65816908be427e1a76a5fa20f.tar.bz2 |
libcsupport: Delete libc_wrapup()
Add and use rtems_libio_exit_helper. Add rtems_libio_exit().
The fclose(stdin) etc. makes no sense during exit. This would use the
_REENT structure of the thread calling _exit().
Diffstat (limited to 'cpukit/libcsupport/src/newlibc_exit.c')
-rw-r--r-- | cpukit/libcsupport/src/newlibc_exit.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/cpukit/libcsupport/src/newlibc_exit.c b/cpukit/libcsupport/src/newlibc_exit.c index 8dbbfce0d2..f0c7b42e0c 100644 --- a/cpukit/libcsupport/src/newlibc_exit.c +++ b/cpukit/libcsupport/src/newlibc_exit.c @@ -11,37 +11,14 @@ #include "config.h" #endif -#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ #include <rtems.h> #if defined(RTEMS_NEWLIB) -#include <rtems/libcsupport.h> +#include <rtems/libio.h> #include <stdio.h> #include <unistd.h> -static void libc_wrapup(void) -{ - /* - * In case RTEMS is already down, don't do this. It could be - * dangerous. - */ - - if (!_System_state_Is_up(_System_state_Get())) - return; - - /* - * Try to drain output buffers. - * - * Should this be changed to do *all* file streams? - * _fwalk (_REENT, fclose); - */ - - fclose (stdin); - fclose (stdout); - fclose (stderr); -} - /* FIXME: These defines are a blatant hack */ #if defined(__USE_INIT_FINI__) @@ -66,7 +43,7 @@ void _exit(int status) FINI_SYMBOL(); #endif - libc_wrapup(); + (*rtems_libio_exit_helper)(); rtems_shutdown_executive(status); for (;;) ; /* to avoid warnings */ } |