From 63682149f8353ec6ef5edeca2cb334355153c273 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 3 Aug 2009 01:05:55 +0000 Subject: 2009-08-02 Joel Sherrill * posix/src/psignal.c: Simplify implementation to ease coverage analysis. --- cpukit/posix/src/psignal.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'cpukit/posix/src/psignal.c') diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c index 60e9a7bfb7..e477cd399e 100644 --- a/cpukit/posix/src/psignal.c +++ b/cpukit/posix/src/psignal.c @@ -112,8 +112,14 @@ void _POSIX_signals_Post_switch_extension( ISR_Level level; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - if ( !api ) + + /* + * api cannot be NULL or we would not have registered this API extension. + */ + #if defined(RTEMS_DEBUG) + if ( !api ) return; + #endif /* * If we invoke any user code, there is the possibility that @@ -124,7 +130,6 @@ void _POSIX_signals_Post_switch_extension( * processed at all. No point in doing this loop otherwise. */ while (1) { - restart: _ISR_Disable( level ); if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { @@ -134,28 +139,16 @@ void _POSIX_signals_Post_switch_extension( _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { - - if ( _POSIX_signals_Check_signal( api, signo, false ) ) - goto restart; - - if ( _POSIX_signals_Check_signal( api, signo, true ) ) - goto restart; - + _POSIX_signals_Check_signal( api, signo, false ); + _POSIX_signals_Check_signal( api, signo, true ); } - - /* XXX - add __SIGFIRSTNOTRT or something like that to newlib signal .h */ + /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { - - if ( _POSIX_signals_Check_signal( api, signo, false ) ) - goto restart; - - if ( _POSIX_signals_Check_signal( api, signo, true ) ) - goto restart; - + _POSIX_signals_Check_signal( api, signo, false ); + _POSIX_signals_Check_signal( api, signo, true ); } } - return; } /*PAGE -- cgit v1.2.3