From dabff06fe8866b9d4fe99b7d53822e7da8f45920 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Fri, 17 Sep 2021 18:30:19 +0200 Subject: [PATCH] - Linux socket layer: ignore EINTR signal during poll function --- hal/socket/linux/socket_linux.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hal/socket/linux/socket_linux.c b/hal/socket/linux/socket_linux.c index 3c3b284c..7a60e879 100644 --- a/hal/socket/linux/socket_linux.c +++ b/hal/socket/linux/socket_linux.c @@ -150,6 +150,10 @@ Handleset_waitReady(HandleSet self, unsigned int timeoutMs) if (self->fds && self->nfds > 0) { int result = poll(self->fds, self->nfds, timeoutMs); + if (result == -1 && errno == EINTR) { + result = 0; + } + if (result == -1) { if (DEBUG_SOCKET) printf("SOCKET: poll error (errno: %i)\n", errno);