Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
darwin: fix return value of uv_sem_init()
Browse files Browse the repository at this point in the history
It should return 0 or -1, not the kernel status code.
  • Loading branch information
bnoordhuis committed Aug 22, 2012
1 parent 8969df6 commit 120e2c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/unix/thread.c
Expand Up @@ -170,7 +170,10 @@ void uv_once(uv_once_t* guard, void (*callback)(void)) {
#if defined(__APPLE__) && defined(__MACH__)

int uv_sem_init(uv_sem_t* sem, unsigned int value) {
return semaphore_create(mach_task_self(), sem, SYNC_POLICY_FIFO, value);
if (semaphore_create(mach_task_self(), sem, SYNC_POLICY_FIFO, value))
return -1;
else
return 0;
}


Expand Down

0 comments on commit 120e2c1

Please sign in to comment.