From fcf114e2b29e34940db17a5aa47b8b8c4ce19532 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Mon, 16 Nov 2020 10:14:59 -0800 Subject: [PATCH] Handle EINTR in ix::poll on Unix --- ixwebsocket/IXNetSystem.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ixwebsocket/IXNetSystem.cpp b/ixwebsocket/IXNetSystem.cpp index c7d45adc..655a52d4 100644 --- a/ixwebsocket/IXNetSystem.cpp +++ b/ixwebsocket/IXNetSystem.cpp @@ -114,16 +114,13 @@ namespace ix // // The style from libuv is as such. // - // int ret = -1; - // do - // { - // ret = ::poll(fds, nfds, timeout); - // } - // while (ret == -1 && errno == EINTR); - // return ret; - // + int ret = -1; + do + { + ret = ::poll(fds, nfds, timeout); + } while (ret == -1 && errno == EINTR); - return ::poll(fds, nfds, timeout); + return ret; #endif }