diff --git a/src/unix/thread.c b/src/unix/thread.c index aa637180..f85de1a4 100644 --- a/src/unix/thread.c +++ b/src/unix/thread.c @@ -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; }