diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-11-23 15:26:52 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-11-23 15:26:52 +0000 |
commit | 8720a3a509f35391cfeb9e875d87e2152f326938 (patch) | |
tree | 7d68149885220c878fc3d1b3bc92007e7bf815eb | |
parent | 2010-11-23 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff) | |
download | rtems-8720a3a509f35391cfeb9e875d87e2152f326938.tar.bz2 |
2010-11-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
* score/src/iterateoverthreads.c, libmisc/cpuuse/cpuusagereport.c:
Avoid dead code if POSIX API is enabled.
-rw-r--r-- | cpukit/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/libmisc/cpuuse/cpuusagereport.c | 18 | ||||
-rw-r--r-- | cpukit/score/src/iterateoverthreads.c | 9 |
3 files changed, 17 insertions, 15 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 3ee1ccc9aa..8ecfc64790 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,6 +1,11 @@ 2010-11-23 Sebastian Huber <sebastian.huber@embedded-brains.de> * score/src/iterateoverthreads.c, libmisc/cpuuse/cpuusagereport.c: + Avoid dead code if POSIX API is enabled. + +2010-11-23 Sebastian Huber <sebastian.huber@embedded-brains.de> + + * score/src/iterateoverthreads.c, libmisc/cpuuse/cpuusagereport.c: Fixed NULL pointer access in case POSIX API is disabled. 2010-11-19 Sebastian Huber <sebastian.huber@embedded-brains.de> diff --git a/cpukit/libmisc/cpuuse/cpuusagereport.c b/cpukit/libmisc/cpuuse/cpuusagereport.c index b46aab7c35..8b7eb00300 100644 --- a/cpukit/libmisc/cpuuse/cpuusagereport.c +++ b/cpukit/libmisc/cpuuse/cpuusagereport.c @@ -71,11 +71,10 @@ void rtems_cpu_usage_report_with_plugin( _Timestamp_Subtract( &CPU_usage_Uptime_at_last_reset, &uptime, &total ); #else for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { - /* - * Since POSIX is optional, this can occur. - */ - if ( !_Objects_Information_table[ api_index ] ) - continue; + #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) + if ( !_Objects_Information_table[ api_index ] ) + continue; + #endif information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { @@ -103,11 +102,10 @@ void rtems_cpu_usage_report_with_plugin( ); for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { - /* - * Since POSIX is optional, this can occur. - */ - if ( !_Objects_Information_table[ api_index ] ) - continue; + #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) + if ( !_Objects_Information_table[ api_index ] ) + continue; + #endif information = _Objects_Information_table[ api_index ][ 1 ]; if ( information ) { diff --git a/cpukit/score/src/iterateoverthreads.c b/cpukit/score/src/iterateoverthreads.c index 34683e6790..8c65becc4c 100644 --- a/cpukit/score/src/iterateoverthreads.c +++ b/cpukit/score/src/iterateoverthreads.c @@ -33,11 +33,10 @@ void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { - /* - * Since POSIX is optional, this can occur. - */ - if ( !_Objects_Information_table[ api_index ] ) - continue; + #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) + if ( !_Objects_Information_table[ api_index ] ) + continue; + #endif information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) |