ipc: Fix compile on musl

This commit is contained in:
Jakob Bornecrantz 2023-11-02 15:05:56 +00:00
parent 981f6408b8
commit 05d04b3ea0

View file

@ -83,9 +83,14 @@ client_loop(volatile struct ipc_client_state *ics)
while (ics->server->running) {
const int half_a_second_ms = 500;
struct epoll_event event = XRT_STRUCT_INIT;
int ret = 0;
// On temporary failures retry.
do {
// We use epoll here to be able to timeout.
ret = epoll_wait(epoll_fd, &event, 1, half_a_second_ms);
} while (ret == -1 && errno == EINTR);
// We use epoll here to be able to timeout.
int ret = TEMP_FAILURE_RETRY(epoll_wait(epoll_fd, &event, 1, half_a_second_ms));
if (ret < 0) {
IPC_ERROR(ics->server, "Failed epoll_wait '%i', disconnecting client.", ret);
break;