From 05d04b3ea01b7788109f8c7b975cad0d854da711 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 2 Nov 2023 15:05:56 +0000 Subject: [PATCH] ipc: Fix compile on musl --- src/xrt/ipc/server/ipc_server_per_client_thread.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xrt/ipc/server/ipc_server_per_client_thread.c b/src/xrt/ipc/server/ipc_server_per_client_thread.c index 2e43e987c..c2d954a99 100644 --- a/src/xrt/ipc/server/ipc_server_per_client_thread.c +++ b/src/xrt/ipc/server/ipc_server_per_client_thread.c @@ -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;