summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/open_dev_console.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-01-25 21:23:53 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-02-03 10:00:57 +0100
commitf64c6b4c492bd4f4efe32ec69e9f4c69bf45be88 (patch)
tree8be32a9c186cb6d9245ee6d8564240ff33291679 /cpukit/libcsupport/src/open_dev_console.c
parentUse linker set for root file system initialization (diff)
downloadrtems-f64c6b4c492bd4f4efe32ec69e9f4c69bf45be88.tar.bz2
Use atexit() handler to close std file descriptors
Diffstat (limited to 'cpukit/libcsupport/src/open_dev_console.c')
-rw-r--r--cpukit/libcsupport/src/open_dev_console.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cpukit/libcsupport/src/open_dev_console.c b/cpukit/libcsupport/src/open_dev_console.c
index 6617a785dd..2e111ccf3a 100644
--- a/cpukit/libcsupport/src/open_dev_console.c
+++ b/cpukit/libcsupport/src/open_dev_console.c
@@ -16,6 +16,7 @@
#include <rtems.h>
#include <rtems/libio.h>
#include <fcntl.h>
+#include <stdlib.h>
/*
* This is a replaceable stub which opens the console, if present.
@@ -45,5 +46,7 @@ void rtems_libio_post_driver(void)
if ((stderr_fd = open("/dev/console", O_WRONLY, 0)) == -1)
rtems_fatal_error_occurred( 0x55544432 ); /* error STD2 */
+
+ atexit(rtems_libio_exit);
}