From 3dddabcc52c3275b77ee351e3d943abf0134b4be Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Fri, 5 Jun 2009 18:54:47 +0000 Subject: [PATCH] Fix highest file descriptor for select(), thanks to Ben Millwood for reporting --- code/qcommon/net_ip.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/qcommon/net_ip.c b/code/qcommon/net_ip.c index 67d71094..ea1a0b3c 100644 --- a/code/qcommon/net_ip.c +++ b/code/qcommon/net_ip.c @@ -1654,8 +1654,7 @@ void NET_Sleep( int msec ) { { FD_SET(ip_socket, &fdset); - if(ip_socket > highestfd) - highestfd = ip_socket; + highestfd = ip_socket; } if(ip6_socket != INVALID_SOCKET) { @@ -1667,7 +1666,7 @@ void NET_Sleep( int msec ) { timeout.tv_sec = msec/1000; timeout.tv_usec = (msec%1000)*1000; - select(ip_socket+1, &fdset, NULL, NULL, &timeout); + select(highestfd + 1, &fdset, NULL, NULL, &timeout); }