From fdbe02c581d579828c1f9344bf53b824f53f82b2 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 9 Sep 2011 06:04:05 +0000 Subject: [PATCH] windows: match _cond_destroy logic w/return variable name CloseHandle returns non-zero on success so earlier versions would leave 'ok' with a misleading value, though the return itself was correct. Change-Id: I21b74a59d90f7bf1b484a55f3960962e933f577b --- src/utils/thread.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/thread.c b/src/utils/thread.c index 0e1789d4..c8c5e9df 100644 --- a/src/utils/thread.c +++ b/src/utils/thread.c @@ -75,10 +75,10 @@ static int pthread_mutex_destroy(pthread_mutex_t* const mutex) { // Condition static int pthread_cond_destroy(pthread_cond_t* const condition) { int ok = 1; - ok &= (CloseHandle(condition->waiting_sem_) == 0); - ok &= (CloseHandle(condition->received_sem_) == 0); - ok &= (CloseHandle(condition->signal_event_) == 0); - return ok; + ok &= (CloseHandle(condition->waiting_sem_) != 0); + ok &= (CloseHandle(condition->received_sem_) != 0); + ok &= (CloseHandle(condition->signal_event_) != 0); + return !ok; } static int pthread_cond_init(pthread_cond_t* const condition, void* cond_attr) {