[PATCH 2/2] INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Nov 21 07:14:42 UTC 2017


Delete superfluous INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL.

Update #3243.
---
 cpukit/posix/src/pthreadinitthreads.c     | 8 +-------
 cpukit/score/include/rtems/score/interr.h | 2 +-
 testsuites/psxtests/psxfatal01/testcase.h | 2 +-
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/cpukit/posix/src/pthreadinitthreads.c b/cpukit/posix/src/pthreadinitthreads.c
index 1777ec9b6d..15c6b9fbf9 100644
--- a/cpukit/posix/src/pthreadinitthreads.c
+++ b/cpukit/posix/src/pthreadinitthreads.c
@@ -40,7 +40,6 @@ void _POSIX_Threads_Initialize_user_threads_body(void)
   posix_initialization_threads_table *user_threads;
   pthread_t                           thread_id;
   pthread_attr_t                      attr;
-  void                             *(*thread_entry)(void *);
 
   user_threads = Configuration_POSIX_API.User_initialization_threads_table;
   maximum      = Configuration_POSIX_API.number_of_initialization_threads;
@@ -66,15 +65,10 @@ void _POSIX_Threads_Initialize_user_threads_body(void)
     eno = pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
     _Assert( eno == 0 );
 
-    thread_entry = user_threads[ index ].thread_entry;
-    if ( thread_entry == NULL ) {
-      _Internal_error( INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL );
-    }
-
     eno = pthread_create(
       &thread_id,
       &attr,
-      thread_entry,
+      user_threads[ index ].thread_entry,
       NULL
     );
     if ( eno != 0 ) {
diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h
index 0c02c21348..4de9406200 100644
--- a/cpukit/score/include/rtems/score/interr.h
+++ b/cpukit/score/include/rtems/score/interr.h
@@ -167,7 +167,7 @@ typedef enum {
   INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR = 24,
   INTERNAL_ERROR_RESOURCE_IN_USE = 25,
   INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL = 26,
-  INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL = 27,
+  /* INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL = 27, */
   INTERNAL_ERROR_THREAD_QUEUE_DEADLOCK = 28,
   INTERNAL_ERROR_THREAD_QUEUE_ENQUEUE_STICKY_FROM_BAD_STATE = 29,
   INTERNAL_ERROR_BAD_THREAD_DISPATCH_DISABLE_LEVEL = 30,
diff --git a/testsuites/psxtests/psxfatal01/testcase.h b/testsuites/psxtests/psxfatal01/testcase.h
index a88ef48945..e67f879ff6 100644
--- a/testsuites/psxtests/psxfatal01/testcase.h
+++ b/testsuites/psxtests/psxfatal01/testcase.h
@@ -29,7 +29,7 @@ posix_initialization_threads_table POSIX_Initialization_threads[] = {
         "POSIX API Init thread create failure - NULL entry"
 #define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_CORE
 #define FATAL_ERROR_EXPECTED_ERROR \
-  INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL
+  INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED
 
 void force_error(void)
 {
-- 
2.12.3



More information about the devel mailing list