summaryrefslogtreecommitdiffstats
path: root/include/zix
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-08-18 16:57:29 -0400
committerDavid Robillard <d@drobilla.net>2022-08-18 16:57:29 -0400
commite45c32c382120319a3403f9356c901b124f145e2 (patch)
treeeb3c202516931e181b3f356e5dc7a37e0e5e4dda /include/zix
parent0c001d5c7fd4c6c5d9ceeb55ba5fac1780b441af (diff)
downloadzix-e45c32c382120319a3403f9356c901b124f145e2.tar.gz
zix-e45c32c382120319a3403f9356c901b124f145e2.tar.bz2
zix-e45c32c382120319a3403f9356c901b124f145e2.zip
Improve test coverage
Diffstat (limited to 'include/zix')
-rw-r--r--include/zix/sem.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/zix/sem.h b/include/zix/sem.h
index 0337f03..3549e02 100644
--- a/include/zix/sem.h
+++ b/include/zix/sem.h
@@ -198,14 +198,11 @@ zix_sem_post(ZixSem* ZIX_NONNULL sem)
static inline ZixStatus
zix_sem_wait(ZixSem* ZIX_NONNULL sem)
{
- while (sem_wait(&sem->sem)) {
- if (errno != EINTR) {
- return ZIX_STATUS_ERROR;
- }
- /* Otherwise, interrupted, so try again. */
+ while (sem_wait(&sem->sem) && errno == EINTR) {
+ // Interrupted, try again
}
- return ZIX_STATUS_SUCCESS;
+ return zix_errno_status(errno);
}
static inline bool