[rtems commit] Add INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED

Sebastian Huber sebh at rtems.org
Mon Dec 12 07:06:01 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Dec  9 09:27:15 2016 +0100

Add INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED

Update #2825.

---

 cpukit/libcsupport/src/open_dev_console.c   | 2 +-
 cpukit/sapi/src/interrtext.c                | 3 ++-
 cpukit/score/include/rtems/score/interr.h   | 3 ++-
 testsuites/sptests/spfatal14/testcase.h     | 4 ++--
 testsuites/sptests/spinternalerror02/init.c | 2 +-
 5 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/cpukit/libcsupport/src/open_dev_console.c b/cpukit/libcsupport/src/open_dev_console.c
index 14257e8..50c1e08 100644
--- a/cpukit/libcsupport/src/open_dev_console.c
+++ b/cpukit/libcsupport/src/open_dev_console.c
@@ -39,7 +39,7 @@ void rtems_libio_post_driver(void)
    *  or something is REALLY wrong.
    */
   if (open("/dev/console", O_WRONLY, 0) != STDOUT_FILENO) {
-    rtems_fatal_error_occurred( 0x55544431 );
+    _Internal_error( INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED );
   }
 
   if (open("/dev/console", O_WRONLY, 0) != STDERR_FILENO) {
diff --git a/cpukit/sapi/src/interrtext.c b/cpukit/sapi/src/interrtext.c
index 2285cd3..f15c82b 100644
--- a/cpukit/sapi/src/interrtext.c
+++ b/cpukit/sapi/src/interrtext.c
@@ -62,7 +62,8 @@ static const char *const internal_error_text[] = {
   "INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED",
   "INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED",
   "INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED",
-  "INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED"
+  "INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED",
+  "INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED"
 };
 
 const char *rtems_internal_error_text( rtems_fatal_code error )
diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h
index d6a961e..61a4153 100644
--- a/cpukit/score/include/rtems/score/interr.h
+++ b/cpukit/score/include/rtems/score/interr.h
@@ -175,7 +175,8 @@ typedef enum {
   INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED = 32,
   INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED = 33,
   INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED = 34,
-  INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED = 35
+  INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED = 35,
+  INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED = 36
 } Internal_errors_Core_list;
 
 typedef CPU_Uint32ptr Internal_errors_t;
diff --git a/testsuites/sptests/spfatal14/testcase.h b/testsuites/sptests/spfatal14/testcase.h
index 3dcd030..d280a17 100644
--- a/testsuites/sptests/spfatal14/testcase.h
+++ b/testsuites/sptests/spfatal14/testcase.h
@@ -11,8 +11,8 @@
 
 #define FATAL_ERROR_TEST_NAME            "14"
 #define FATAL_ERROR_DESCRIPTION          "fail to open stdout"
-#define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_RTEMS_API
-#define FATAL_ERROR_EXPECTED_ERROR       0x55544431
+#define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_CORE
+#define FATAL_ERROR_EXPECTED_ERROR       INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED
 
 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 1
 
diff --git a/testsuites/sptests/spinternalerror02/init.c b/testsuites/sptests/spinternalerror02/init.c
index 69bc89f..aa5f12e 100644
--- a/testsuites/sptests/spinternalerror02/init.c
+++ b/testsuites/sptests/spinternalerror02/init.c
@@ -36,7 +36,7 @@ static void test_internal_error_text(void)
   } while ( text != text_last );
 
   rtems_test_assert(
-    error - 3 == INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED
+    error - 3 == INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED
   );
 }
 



More information about the vc mailing list