diff --git a/cpukit/posix/src/pthreadsigmask.c b/cpukit/posix/src/pthreadsigmask.c index b484580cb1..1537ce5a4b 100644 --- a/cpukit/posix/src/pthreadsigmask.c +++ b/cpukit/posix/src/pthreadsigmask.c @@ -58,8 +58,9 @@ int pthread_sigmask( { POSIX_API_Control *api; - if ( !set && !oset ) - rtems_set_errno_and_return_minus_one( EINVAL ); + if ( !set && !oset ) { + return EINVAL; + } api = _Thread_Get_executing()->API_Extensions[ THREAD_API_POSIX ]; @@ -80,7 +81,7 @@ int pthread_sigmask( api->signals_unblocked = ~*set; break; default: - rtems_set_errno_and_return_minus_one( EINVAL ); + return EINVAL; } /* XXX are there critical section problems here? */ diff --git a/cpukit/posix/src/sigprocmask.c b/cpukit/posix/src/sigprocmask.c index 38a640aa37..383162ff26 100644 --- a/cpukit/posix/src/sigprocmask.c +++ b/cpukit/posix/src/sigprocmask.c @@ -57,7 +57,15 @@ int sigprocmask( */ #if defined(RTEMS_POSIX_API) - return pthread_sigmask( how, set, oset ); + int status; + + status = pthread_sigmask( how, set, oset ); + + if ( status == 0 ) { + return 0; + } + + return -1; #else return -1; #endif diff --git a/testsuites/psxtests/psx04/init.c b/testsuites/psxtests/psx04/init.c index 7f196ef716..54fcaa6051 100644 --- a/testsuites/psxtests/psx04/init.c +++ b/testsuites/psxtests/psx04/init.c @@ -535,15 +535,15 @@ void *POSIX_Init( puts( "Init: sigaction - EINVAL (SIGKILL)" ); status = pthread_sigmask( SIG_BLOCK, NULL, NULL ); - if ( status != -1 ) + if ( status != EINVAL ) printf( "status = %d\n", status ); - rtems_test_assert( errno == EINVAL ); + rtems_test_assert( status == EINVAL ); puts( "Init: pthread_sigmask - EINVAL (set and oset invalid)" ); status = pthread_sigmask( 999, &pending_set, NULL ); - if ( status != -1 ) + if ( status != EINVAL ) printf( "status = %d\n", status ); - rtems_test_assert( errno == EINVAL ); + rtems_test_assert( status == EINVAL ); puts( "Init: pthread_sigmask - EINVAL (how invalid)" ); status = sigpending( NULL ); @@ -557,14 +557,14 @@ void *POSIX_Init( if ( status != -1 ) printf( "status = %d\n", status ); rtems_test_assert( errno == EINVAL ); - puts( "Init: pthread_sigmask - EINVAL (timout->nsec invalid < 0)" ); + puts( "Init: sigtimedwait - EINVAL (timout->nsec invalid < 0)" ); timeout.tv_nsec = 0x7fffffff; status = sigtimedwait( &mask, &info, &timeout ); if ( status != -1 ) printf( "status = %d\n", status ); rtems_test_assert( errno == EINVAL ); - puts( "Init: pthread_sigmask - EINVAL (timout->nsec invalid to large)" ); + puts( "Init: sigtimedwait - EINVAL (timout->nsec invalid to large)" ); status = pthread_kill( Init_id, 999 ); rtems_test_assert( status == EINVAL ); diff --git a/testsuites/psxtests/psx04/psx04.scn b/testsuites/psxtests/psx04/psx04.scn index 555413d63a..2e0cf89e00 100644 --- a/testsuites/psxtests/psx04/psx04.scn +++ b/testsuites/psxtests/psx04/psx04.scn @@ -99,8 +99,8 @@ Init: sigaction - EINVAL (SIGKILL) Init: pthread_sigmask - EINVAL (set and oset invalid) Init: pthread_sigmask - EINVAL (how invalid) Init: sigpending - EINVAL (set invalid) -Init: pthread_sigmask - EINVAL (timout->nsec invalid < 0) -Init: pthread_sigmask - EINVAL (timout->nsec invalid to large) +Init: sigtimedwait - EINVAL (timout->nsec invalid < 0) +Init: sigtimedwait - EINVAL (timout->nsec invalid to large) Init: pthread_kill - EINVAL (sig invalid) Init: pthread_kill - EINVAL (signal = 0) Init: pthread_kill - SUCCESSFUL (signal = SIG_IGN)