Fixed #5889: Only add descriptors wanted to select

This commit is contained in:
Armin Novak 2020-02-18 11:54:28 +01:00 committed by akallabeth
parent c157067ccf
commit 75be471d78

View File

@ -415,14 +415,18 @@ DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAl
pollfds[polled].events = handle_mode_to_pollevent(Object->Mode);
pollfds[polled].revents = 0;
#else
FD_SET(fd, &rfds);
FD_SET(fd, &wfds);
if (Object->Mode & WINPR_FD_READ)
{
FD_SET(fd, &rfds);
prfds = &rfds;
}
if (Object->Mode & WINPR_FD_WRITE)
{
FD_SET(fd, &wfds);
pwfds = &wfds;
}
if (fd > maxfd)
maxfd = fd;