summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/test-pthread.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Userland/Utilities/test-pthread.cpp b/Userland/Utilities/test-pthread.cpp
index de73f3f9e8..2b11604c0d 100644
--- a/Userland/Utilities/test-pthread.cpp
+++ b/Userland/Utilities/test-pthread.cpp
@@ -107,7 +107,8 @@ static ErrorOr<void> test_semaphore_as_lock()
VERIFY(v.size() == threads_count * num_times);
VERIFY(sem_trywait(&semaphore) == 0);
- VERIFY(sem_trywait(&semaphore) == EAGAIN);
+ VERIFY(sem_trywait(&semaphore) == -1);
+ VERIFY(errno == EAGAIN);
return {};
}
@@ -136,7 +137,8 @@ static ErrorOr<void> test_semaphore_as_event()
[[maybe_unused]] auto r1 = reader->join();
[[maybe_unused]] auto r2 = writer->join();
- VERIFY(sem_trywait(&semaphore) == EAGAIN);
+ VERIFY(sem_trywait(&semaphore) == -1);
+ VERIFY(errno == EAGAIN);
return {};
}
@@ -181,7 +183,8 @@ static ErrorOr<void> test_semaphore_nonbinary()
for (size_t i = 0; i < num; i++) {
VERIFY(sem_trywait(&semaphore) == 0);
}
- VERIFY(sem_trywait(&semaphore) == EAGAIN);
+ VERIFY(sem_trywait(&semaphore) == -1);
+ VERIFY(errno == EAGAIN);
return {};
}