2006-11-17 Joel Sherrill <joel@OARcorp.com>

* posix/src/semtimedwait.c: Used wrong constant for blocking with bad
	timeout value.
This commit is contained in:
Joel Sherrill
2006-11-17 22:52:24 +00:00
parent ce6568eb65
commit e2cafb006a
2 changed files with 11 additions and 6 deletions

View File

@@ -1,3 +1,8 @@
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> 2006-11-17 Joel Sherrill <joel@OARcorp.com>
* posix/src/keygetspecific.c, posix/src/keysetspecific.c: Correct * posix/src/keygetspecific.c, posix/src/keysetspecific.c: Correct

View File

@@ -48,18 +48,18 @@ int sem_timedwait(
blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE; blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE;
else else
#endif #endif
if ( abstime->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) if ( abstime->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE; blocking = CORE_SEMAPHORE_BAD_TIMEOUT;
else { } else {
(void) clock_gettime( CLOCK_REALTIME, &current_time ); clock_gettime( CLOCK_REALTIME, &current_time );
/* /*
* Make sure the abstime is in the future * Make sure the abstime is in the future
*/ */
if ( abstime->tv_sec < current_time.tv_sec ) 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) && else if ( (abstime->tv_sec == current_time.tv_sec) &&
(abstime->tv_nsec <= current_time.tv_nsec) ) (abstime->tv_nsec <= current_time.tv_nsec) )
blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE; blocking = CORE_SEMAPHORE_BAD_TIMEOUT;
else { else {
_POSIX_Timespec_subtract( &current_time, abstime, &difference ); _POSIX_Timespec_subtract( &current_time, abstime, &difference );
ticks = _POSIX_Timespec_to_interval( &difference ); ticks = _POSIX_Timespec_to_interval( &difference );