summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-23 23:02:35 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-23 23:02:35 +0100
commita4e6a027a19af1f68e761331043c1b80b000a3cb (patch)
tree238b81eaa0ee2a9331ed49490f406dc6a29532e9 /source
parentCryptoPP: Pruned unused files (diff)
downloadcuberite-a4e6a027a19af1f68e761331043c1b80b000a3cb.tar
cuberite-a4e6a027a19af1f68e761331043c1b80b000a3cb.tar.gz
cuberite-a4e6a027a19af1f68e761331043c1b80b000a3cb.tar.bz2
cuberite-a4e6a027a19af1f68e761331043c1b80b000a3cb.tar.lz
cuberite-a4e6a027a19af1f68e761331043c1b80b000a3cb.tar.xz
cuberite-a4e6a027a19af1f68e761331043c1b80b000a3cb.tar.zst
cuberite-a4e6a027a19af1f68e761331043c1b80b000a3cb.zip
Diffstat (limited to 'source')
-rw-r--r--source/OSSupport/ListenThread.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/OSSupport/ListenThread.cpp b/source/OSSupport/ListenThread.cpp
index 27c77a897..9e2a07f3c 100644
--- a/source/OSSupport/ListenThread.cpp
+++ b/source/OSSupport/ListenThread.cpp
@@ -205,7 +205,10 @@ void cListenThread::Execute(void)
FD_SET(itr->GetSocket(), &fdRead);
} // for itr - m_Sockets[]
- if (select(Highest + 1, &fdRead, NULL, NULL, NULL) == -1)
+ timeval tv; // On Linux select() doesn't seem to wake up when socket is closed, so let's kinda busy-wait:
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+ if (select(Highest + 1, &fdRead, NULL, NULL, &tv) == -1)
{
LOG("select(R) call failed in cListenThread: \"%s\"", cSocket::GetLastErrorString().c_str());
continue;