[rtems commit] libio: Use CONSOLE_DEVICE_NAME

Sebastian Huber sebh at rtems.org
Fri Dec 23 12:55:23 UTC 2016


Module:    rtems
Branch:    master
Commit:    0374ccd8ab48dd7ff3a36ec52443f6b875690953
Changeset: http://git.rtems.org/rtems/commit/?id=0374ccd8ab48dd7ff3a36ec52443f6b875690953

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Dec 23 13:53:55 2016 +0100

libio: Use CONSOLE_DEVICE_NAME

---

 cpukit/libcsupport/src/open_dev_console.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/cpukit/libcsupport/src/open_dev_console.c b/cpukit/libcsupport/src/open_dev_console.c
index 5bba0fb..d5bc8ef 100644
--- a/cpukit/libcsupport/src/open_dev_console.c
+++ b/cpukit/libcsupport/src/open_dev_console.c
@@ -15,6 +15,7 @@
 
 #include <rtems.h>
 #include <rtems/libio.h>
+#include <rtems/console.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -27,7 +28,7 @@ void rtems_libio_post_driver(void)
   /*
    * Attempt to open /dev/console.
    */
-  if (open("/dev/console", O_RDONLY, 0) != STDIN_FILENO) {
+  if ( open( CONSOLE_DEVICE_NAME, O_RDONLY, 0 ) != STDIN_FILENO ) {
     /*
      * There may not be a console driver so this is OK.
      */
@@ -38,11 +39,11 @@ void rtems_libio_post_driver(void)
    *  But if we find /dev/console once, we better find it twice more
    *  or something is REALLY wrong.
    */
-  if (open("/dev/console", O_WRONLY, 0) != STDOUT_FILENO) {
+  if ( open( CONSOLE_DEVICE_NAME, O_WRONLY, 0 ) != STDOUT_FILENO ) {
     _Internal_error( INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED );
   }
 
-  if (open("/dev/console", O_WRONLY, 0) != STDERR_FILENO) {
+  if ( open( CONSOLE_DEVICE_NAME, O_WRONLY, 0 ) != STDERR_FILENO ) {
     _Internal_error( INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED );
   }
 




More information about the vc mailing list