mirror of
https://git.freebsd.org/ports.git
synced 2025-06-06 13:20:32 -04:00
Applicable only to non-Linux platforms, such as FreeBSD. Bump PORTREVISION. Obtained from: https://sourceforge.net/p/udt/patches/12/
30 lines
1 KiB
Text
30 lines
1 KiB
Text
From
|
|
http://sourceforge.net/p/udt/patches/12/
|
|
|
|
--- src/epoll.cpp
|
|
+++ src/epoll.cpp
|
|
@@ -256,18 +256,23 @@ int CEPoll::wait(const int eid, set<UDTSOCKET>* readfds, set<UDTSOCKET>* writefd
|
|
FD_ZERO(&readfds);
|
|
FD_ZERO(&writefds);
|
|
|
|
+ //"select" needs to know the max file descriptor that is set in the fd_set structs
|
|
+ SYSSOCKET max_fd = 0;
|
|
+
|
|
for (set<SYSSOCKET>::const_iterator i = p->second.m_sLocals.begin(); i != p->second.m_sLocals.end(); ++ i)
|
|
{
|
|
if (lrfds)
|
|
FD_SET(*i, &readfds);
|
|
if (lwfds)
|
|
FD_SET(*i, &writefds);
|
|
+ if (*i > max_fd)
|
|
+ max_fd = *i;
|
|
}
|
|
|
|
timeval tv;
|
|
tv.tv_sec = 0;
|
|
tv.tv_usec = 0;
|
|
- if (::select(0, &readfds, &writefds, NULL, &tv) > 0)
|
|
+ if (::select(max_fd + 1, &readfds, &writefds, NULL, &tv) > 0)
|
|
{
|
|
for (set<SYSSOCKET>::const_iterator i = p->second.m_sLocals.begin(); i != p->second.m_sLocals.end(); ++ i)
|
|
{
|