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

* posix/src/semtimedwait.c: Reverse accidentally included
	semtimedwait.c.
This commit is contained in:
Joel Sherrill
2006-11-17 22:51:12 +00:00
parent 4d0bb65e12
commit 44bc19a795
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: Reverse accidentally included
semtimedwait.c.
2006-11-17 Joel Sherrill <joel@OARcorp.com> 2006-11-17 Joel Sherrill <joel@OARcorp.com>
* posix/src/keygetspecific.c, posix/src/keysetspecific.c, * posix/src/keygetspecific.c, posix/src/keysetspecific.c,

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; blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE;
} else { else {
clock_gettime( CLOCK_REALTIME, &current_time ); (void) 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; blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE;
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; blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE;
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 );