From 3799e0da4326134622b8477b8ffefffb0a849dc9 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 16 Jul 2018 01:50:21 +0200 Subject: [PATCH] Infer socket readiness from select() return value. --- common/TracySocket.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/TracySocket.cpp b/common/TracySocket.cpp index 44ffd266..8eb54241 100644 --- a/common/TracySocket.cpp +++ b/common/TracySocket.cpp @@ -233,8 +233,7 @@ bool Socket::HasData() FD_ZERO( &fds ); FD_SET( m_sock, &fds ); - select( m_sock+1, &fds, nullptr, nullptr, &tv ); - return FD_ISSET( m_sock, &fds ); + return select( m_sock+1, &fds, nullptr, nullptr, &tv ) > 0; }