diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2006-11-17 22:49:30 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2006-11-17 22:49:30 +0000 |
commit | 4d0bb65e12cd42768348d26d715c549389cc4894 (patch) | |
tree | e111cd7a6f40b75a32257dd3cb42be9a647b821d /cpukit | |
parent | 2006-11-17 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-4d0bb65e12cd42768348d26d715c549389cc4894.tar.bz2 |
2006-11-17 Joel Sherrill <joel@OARcorp.com>
* posix/src/keygetspecific.c, posix/src/keysetspecific.c,
posix/src/semtimedwait.c: Correct indexing of key data to use api and
index NOT class and index. Class is always 1.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 6 | ||||
-rw-r--r-- | cpukit/posix/src/keygetspecific.c | 8 | ||||
-rw-r--r-- | cpukit/posix/src/keysetspecific.c | 6 | ||||
-rw-r--r-- | cpukit/posix/src/semtimedwait.c | 12 |
4 files changed, 19 insertions, 13 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 6e36c10ccb..496beb108b 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2006-11-17 Joel Sherrill <joel@OARcorp.com> + + * posix/src/keygetspecific.c, posix/src/keysetspecific.c, + posix/src/semtimedwait.c: Correct indexing of key data to use api and + index NOT class and index. Class is always 1. + 2006-11-17 Ralf Corsépius <ralf.corsepius@rtems.org> * configure.ac: Suppress itron if int8/int16_t are not provided. diff --git a/cpukit/posix/src/keygetspecific.c b/cpukit/posix/src/keygetspecific.c index ee6912022c..01e5549512 100644 --- a/cpukit/posix/src/keygetspecific.c +++ b/cpukit/posix/src/keygetspecific.c @@ -26,8 +26,8 @@ void *pthread_getspecific( ) { register POSIX_Keys_Control *the_key; + uint32_t api; uint32_t index; - uint32_t class; Objects_Locations location; void *key_data; @@ -37,9 +37,9 @@ void *pthread_getspecific( case OBJECTS_REMOTE: /* should never happen */ return NULL; case OBJECTS_LOCAL: - index = _Objects_Get_index( _Thread_Executing->Object.id ); - class = _Objects_Get_class( _Thread_Executing->Object.id ); - key_data = (void *) the_key->Values[ class ][ index ]; + api = _Objects_Get_API( _Thread_Executing->Object.id ); + index = _Objects_Get_index( _Thread_Executing->Object.id ); + key_data = (void *) the_key->Values[ api ][ index ]; _Thread_Enable_dispatch(); return key_data; } diff --git a/cpukit/posix/src/keysetspecific.c b/cpukit/posix/src/keysetspecific.c index 30f10a06b4..63370b4adf 100644 --- a/cpukit/posix/src/keysetspecific.c +++ b/cpukit/posix/src/keysetspecific.c @@ -27,8 +27,8 @@ int pthread_setspecific( ) { register POSIX_Keys_Control *the_key; + uint32_t api; uint32_t index; - uint32_t class; Objects_Locations location; the_key = _POSIX_Keys_Get( key, &location ); @@ -37,9 +37,9 @@ int pthread_setspecific( case OBJECTS_REMOTE: /* should never happen */ return EINVAL; case OBJECTS_LOCAL: + api = _Objects_Get_API( _Thread_Executing->Object.id ); index = _Objects_Get_index( _Thread_Executing->Object.id ); - class = _Objects_Get_class( _Thread_Executing->Object.id ); - the_key->Values[ class ][ index ] = (void *) value; + the_key->Values[ api ][ index ] = (void *) value; _Thread_Enable_dispatch(); return 0; } diff --git a/cpukit/posix/src/semtimedwait.c b/cpukit/posix/src/semtimedwait.c index b0cb78deca..662845ecd9 100644 --- a/cpukit/posix/src/semtimedwait.c +++ b/cpukit/posix/src/semtimedwait.c @@ -48,18 +48,18 @@ int sem_timedwait( blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE; else #endif - if ( abstime->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) - blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE; - else { - (void) clock_gettime( CLOCK_REALTIME, ¤t_time ); + if ( abstime->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { + blocking = CORE_SEMAPHORE_BAD_TIMEOUT; + } else { + clock_gettime( CLOCK_REALTIME, ¤t_time ); /* * Make sure the abstime is in the future */ if ( abstime->tv_sec < current_time.tv_sec ) - blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE; + blocking = CORE_SEMAPHORE_BAD_TIMEOUT; else if ( (abstime->tv_sec == current_time.tv_sec) && (abstime->tv_nsec <= current_time.tv_nsec) ) - blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE; + blocking = CORE_SEMAPHORE_BAD_TIMEOUT; else { _POSIX_Timespec_subtract( ¤t_time, abstime, &difference ); ticks = _POSIX_Timespec_to_interval( &difference ); |