[rtems commit] Add INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED

Sebastian Huber sebh at rtems.org
Mon Dec 12 07:05:13 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Dec  9 06:51:44 2016 +0100

Add INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED

Update #2825.

---

 cpukit/posix/src/pthreadinitthreads.c       | 8 ++++++--
 cpukit/sapi/src/interrtext.c                | 3 ++-
 cpukit/score/include/rtems/score/interr.h   | 3 ++-
 testsuites/psxtests/psxfatal02/testcase.h   | 4 ++--
 testsuites/sptests/spinternalerror02/init.c | 2 +-
 5 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/cpukit/posix/src/pthreadinitthreads.c b/cpukit/posix/src/pthreadinitthreads.c
index 3cfb92d..2fdfa53 100644
--- a/cpukit/posix/src/pthreadinitthreads.c
+++ b/cpukit/posix/src/pthreadinitthreads.c
@@ -102,7 +102,11 @@ void _POSIX_Threads_Initialize_user_threads_body(void)
       thread_entry,
       NULL
     );
-    if ( eno )
-      _POSIX_Fatal_error( POSIX_FD_PTHREAD, eno );
+    if ( eno != 0 ) {
+      _Terminate(
+        INTERNAL_ERROR_CORE,
+        INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED
+      );
+    }
   }
 }
diff --git a/cpukit/sapi/src/interrtext.c b/cpukit/sapi/src/interrtext.c
index 55b79d1..b2211ea 100644
--- a/cpukit/sapi/src/interrtext.c
+++ b/cpukit/sapi/src/interrtext.c
@@ -59,7 +59,8 @@ static const char *const internal_error_text[] = {
   "INTERNAL_ERROR_THREAD_QUEUE_ENQUEUE_STICKY_FROM_BAD_STATE",
   "INTERNAL_ERROR_BAD_THREAD_DISPATCH_DISABLE_LEVEL",
   "INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT",
-  "INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED"
+  "INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED",
+  "INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_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 cd72dea..aaaacf5 100644
--- a/cpukit/score/include/rtems/score/interr.h
+++ b/cpukit/score/include/rtems/score/interr.h
@@ -172,7 +172,8 @@ typedef enum {
   INTERNAL_ERROR_THREAD_QUEUE_ENQUEUE_STICKY_FROM_BAD_STATE = 29,
   INTERNAL_ERROR_BAD_THREAD_DISPATCH_DISABLE_LEVEL = 30,
   INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT = 31,
-  INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED = 32
+  INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED = 32,
+  INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED = 33
 } Internal_errors_Core_list;
 
 typedef CPU_Uint32ptr Internal_errors_t;
diff --git a/testsuites/psxtests/psxfatal02/testcase.h b/testsuites/psxtests/psxfatal02/testcase.h
index facf731..7f97a67 100644
--- a/testsuites/psxtests/psxfatal02/testcase.h
+++ b/testsuites/psxtests/psxfatal02/testcase.h
@@ -32,8 +32,8 @@ posix_initialization_threads_table POSIX_Initialization_threads[] = {
 #define FATAL_ERROR_TEST_NAME            "2"
 #define FATAL_ERROR_DESCRIPTION \
         "POSIX API Init thread create failure -- no memory for stack"
-#define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_POSIX_API
-#define FATAL_ERROR_EXPECTED_ERROR       ((POSIX_FD_PTHREAD << 8) | EAGAIN)
+#define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_CORE
+#define FATAL_ERROR_EXPECTED_ERROR       INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED
 
 void force_error(void)
 {
diff --git a/testsuites/sptests/spinternalerror02/init.c b/testsuites/sptests/spinternalerror02/init.c
index 5bea4f1..011a7fe 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_RTEMS_INIT_TASK_CREATE_FAILED
+    error - 3 == INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED
   );
 }
 




More information about the vc mailing list