mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-02 04:20:28 +00:00
LibPthread: Correct error check in sem_post
and sem_wait
This commit is contained in:
parent
8f6b496fed
commit
40ddb734ee
Notes:
sideshowbarker
2024-07-18 17:05:37 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/40ddb734ee2 Pull-request: https://github.com/SerenityOS/serenity/pull/7645 Reviewed-by: https://github.com/gunnarbeutner ✅
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue