From 1ea5db6110cbdd739305093cbae4049b74b7111f Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Sat, 26 Jan 2019 20:57:48 -0800 Subject: [PATCH] linux fix --- .travis.yml | 2 +- ixwebsocket/IXSocket.cpp | 14 ++++++++++---- test/run.py | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec96d822..4dfb451e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,5 @@ compiler: - clang # - gcc -os: osx + # os: osx script: make test diff --git a/ixwebsocket/IXSocket.cpp b/ixwebsocket/IXSocket.cpp index 7d5a6f0d..42854e05 100644 --- a/ixwebsocket/IXSocket.cpp +++ b/ixwebsocket/IXSocket.cpp @@ -45,14 +45,20 @@ namespace ix } #ifdef __linux__ - FD_SET(_eventfd.getFd(), &rfds); + int nfds = 2; +#else + int nfds = 1; #endif - struct pollfd fds[1]; + + struct pollfd fds[nfds]; fds[0].fd = _sockfd; fds[0].events = POLLIN | POLLHUP | POLLERR; - int timeout_msecs = timeoutSecs * 1000; - int ret = ::poll(fds, 1, timeout_msecs); +#ifdef __linux__ + fds[1].fd = _eventfd.getFd(); + fds[1].events = POLLIN | POLLHUP | POLLERR; +#endif + int ret = ::poll(fds, nfds, timeoutSecs * 1000); PollResultType pollResult = PollResultType_ReadyForRead; if (ret < 0) diff --git a/test/run.py b/test/run.py index 3cee95bd..49586b1f 100644 --- a/test/run.py +++ b/test/run.py @@ -30,7 +30,7 @@ sanitizersFlags = { } sanitizer = 'tsan' if osName == 'Linux': - sanitizer = 'asan' + sanitizer = 'none' sanitizerFlags = sanitizersFlags[sanitizer]