Revision: 139 http://trac.macosforge.org/projects/libdispatch/changeset/139 Author: robert@fledge.watson.org Date: 2009-11-05 07:15:18 -0800 (Thu, 05 Nov 2009) Log Message: ----------- Move 'nsec' definition into #if USE_MACH_SEM as it's no longer required with sem_timedwait(). Fix another instance of the sem_timedwait() return value checking bug. Modified Paths: -------------- trunk/src/semaphore.c Modified: trunk/src/semaphore.c =================================================================== --- trunk/src/semaphore.c 2009-11-05 10:34:37 UTC (rev 138) +++ trunk/src/semaphore.c 2009-11-05 15:15:18 UTC (rev 139) @@ -155,12 +155,12 @@ #if USE_MACH_SEM mach_timespec_t _timeout; kern_return_t kr; + uint64_t nsec; #endif #if USE_POSIX_SEM struct timespec _timeout; int ret; #endif - uint64_t nsec; long orig; again: @@ -440,12 +440,12 @@ #if USE_MACH_SEM mach_timespec_t _timeout; kern_return_t kr; + uint64_t nsec; #endif #if USE_POSIX_SEM struct timespec _timeout; int ret; #endif - uint64_t nsec; long orig; again: @@ -494,7 +494,8 @@ ret = slowpath(sem_timedwait(&dsema->dsema_sem, &_timeout)); } while (ret == -1 && errno == EINTR); - if (ret == 0 || errno != ETIMEDOUT) { + + if (!(ret == -1 && errno == ETIMEDOUT)) { DISPATCH_SEMAPHORE_VERIFY_RET(ret); break; }
participants (1)
-
source_changes@macosforge.org