diff options
author | David Robillard <d@drobilla.net> | 2022-08-18 16:57:29 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-08-18 16:57:29 -0400 |
commit | e45c32c382120319a3403f9356c901b124f145e2 (patch) | |
tree | eb3c202516931e181b3f356e5dc7a37e0e5e4dda /include | |
parent | 0c001d5c7fd4c6c5d9ceeb55ba5fac1780b441af (diff) | |
download | zix-e45c32c382120319a3403f9356c901b124f145e2.tar.gz zix-e45c32c382120319a3403f9356c901b124f145e2.tar.bz2 zix-e45c32c382120319a3403f9356c901b124f145e2.zip |
Improve test coverage
Diffstat (limited to 'include')
-rw-r--r-- | include/zix/sem.h | 9 |
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 |