svn commit: r343828 - in head/net/udt: . files
Mikhail Teterin
mi at FreeBSD.org
Tue Feb 11 22:35:46 UTC 2014
Author: mi
Date: Tue Feb 11 22:35:45 2014
New Revision: 343828
URL: http://svnweb.freebsd.org/changeset/ports/343828
QAT: https://qat.redports.org/buildarchive/r343828/
Log:
Add a patch to make the invocation of select(2) work in CEPoll::wait() method.
Applicable only to non-Linux platforms, such as FreeBSD.
Bump PORTREVISION.
Obtained from: https://sourceforge.net/p/udt/patches/12/
Added:
head/net/udt/files/patch-fix-select-call (contents, props changed)
Modified:
head/net/udt/Makefile
Modified: head/net/udt/Makefile
==============================================================================
--- head/net/udt/Makefile Tue Feb 11 22:12:21 2014 (r343827)
+++ head/net/udt/Makefile Tue Feb 11 22:35:45 2014 (r343828)
@@ -3,6 +3,7 @@
PORTNAME= udt
PORTVERSION= 4.11
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= SF
DISTNAME= udt.sdk.${PORTVERSION}
Added: head/net/udt/files/patch-fix-select-call
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/udt/files/patch-fix-select-call Tue Feb 11 22:35:45 2014 (r343828)
@@ -0,0 +1,30 @@
+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)
+ {
More information about the svn-ports-all
mailing list