diff --git a/Userland/Libraries/LibPthread/semaphore.cpp b/Userland/Libraries/LibPthread/semaphore.cpp index 3b4eb73ba49..3983e6da4b7 100644 --- a/Userland/Libraries/LibPthread/semaphore.cpp +++ b/Userland/Libraries/LibPthread/semaphore.cpp @@ -111,7 +111,7 @@ int sem_post(sem_t* sem) } rc = pthread_mutex_unlock(&sem->mtx); - if (errno != 0) { + if (rc != 0) { errno = rc; return -1; } @@ -153,7 +153,7 @@ int sem_unlink(const char*) int sem_wait(sem_t* sem) { auto rc = pthread_mutex_lock(&sem->mtx); - if (errno != 0) { + if (rc != 0) { errno = rc; return -1; }