Util: Fix highest-fd socket not being returned by SocketAccept

This commit is contained in:
Vicki Pfau 2017-02-07 13:19:45 -08:00
parent af96097bb1
commit b54a4ba555
2 changed files with 3 additions and 1 deletions

View File

@ -25,6 +25,7 @@ Bugfixes:
- Util: Fix overflow when loading invalid UPS patches
- Tools: Fix recurring multiple times over the same library
- GBA I/O: Handle audio registers specially when deserializing
- Util: Fix highest-fd socket not being returned by SocketAccept
Misc:
- SDL: Remove scancode key input
- GBA Video: Clean up unused timers

View File

@ -293,10 +293,11 @@ static inline int SocketPoll(size_t nSockets, Socket* reads, Socket* writes, Soc
errors[i] = INVALID_SOCKET;
}
}
++maxFd;
struct timeval tv;
tv.tv_sec = timeoutMillis / 1000;
tv.tv_usec = (timeoutMillis % 1000) * 1000;
int result = select(maxFd + 1, &rset, &wset, &eset, timeoutMillis < 0 ? 0 : &tv);
int result = select(maxFd, &rset, &wset, &eset, timeoutMillis < 0 ? 0 : &tv);
int r = 0;
int w = 0;
int e = 0;