From 08b9db66ac0a5d4fa92dcb82820e1435f203ea42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 1 Feb 2021 18:48:51 +0100 Subject: [PATCH] poorman: handle EINTR on poll() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I549db55a408063bbddf71d5ce15c0286bf36bc69 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3727 Reviewed-by: waddlesplash Reviewed-by: Axel Dörfler --- src/apps/poorman/PoorManServer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/apps/poorman/PoorManServer.cpp b/src/apps/poorman/PoorManServer.cpp index 0b53dd8104..357e7ace51 100644 --- a/src/apps/poorman/PoorManServer.cpp +++ b/src/apps/poorman/PoorManServer.cpp @@ -8,6 +8,7 @@ #include "PoorManServer.h" +#include #include #include #include @@ -226,6 +227,8 @@ int32 PoorManServer::_Listener(void* data) while (s->fIsRunning) { // Wait for listen4_fd or listen6_fd (or both!) to become ready: retval = poll(fds, nfds, -1); + if (retval == -1 && errno == EINTR) + continue; if (retval < 1) { return -1; // fds no longer available }