diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2006-11-17 22:53:56 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2006-11-17 22:53:56 +0000 |
commit | 8441e5ef83b435cb5ef17a751dddaa61fb637f84 (patch) | |
tree | 048dacb659df2f0f3eff3d1545ac5acb7b287d4d | |
parent | 2006-11-17 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-8441e5ef83b435cb5ef17a751dddaa61fb637f84.tar.bz2 |
2006-11-17 Joel Sherrill <joel@OARcorp.com>
* posix/src/semtimedwait.c: Used wrong constant for blocking with bad
timeout value.
-rw-r--r-- | cpukit/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/posix/src/semtimedwait.c | 12 |
2 files changed, 11 insertions, 6 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index c3cfb5501f..3192859ee2 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,10 @@ 2006-11-17 Joel Sherrill <joel@OARcorp.com> + * posix/src/semtimedwait.c: Used wrong constant for blocking with bad + timeout value. + +2006-11-17 Joel Sherrill <joel@OARcorp.com> + * posix/src/semtimedwait.c: Reverse accidentally included semtimedwait.c. 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 ); |