1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:47:44 +00:00

LibPthread: Correct error check in sem_post and sem_wait

This commit is contained in:
Jelle Raaijmakers 2021-05-31 23:11:15 +02:00 committed by Andreas Kling
parent 8f6b496fed
commit 40ddb734ee

View file

@ -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;
}