aboutsummaryrefslogtreecommitdiff
path: root/src/Platform/Posix/Semaphore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Platform/Posix/Semaphore.c')
-rw-r--r--src/Platform/Posix/Semaphore.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Platform/Posix/Semaphore.c b/src/Platform/Posix/Semaphore.c
index 2fb03a1..e4c5f5b 100644
--- a/src/Platform/Posix/Semaphore.c
+++ b/src/Platform/Posix/Semaphore.c
@@ -64,9 +64,11 @@ int BH_SemaphoreWaitFor(BH_Semaphore *semaphore,
if (convertToTimespec(&ts, timeout))
return BH_ERROR;
- switch (sem_timedwait(&semaphore->handle, &ts))
+ if (!sem_timedwait(&semaphore->handle, &ts))
+ return BH_OK;
+
+ switch (errno)
{
- case 0: return BH_OK;
case ETIMEDOUT: return BH_TIMEOUT;
default: return BH_ERROR;
}