mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 06:48:05 +01:00
Clear revents even when no events are received. Also, since everyone gets in exceptions, everyone gets to increment maxfd.
svn:r550
This commit is contained in:
parent
74e6c03cab
commit
3d7463d2b3
1 changed files with 4 additions and 5 deletions
|
@ -49,12 +49,12 @@ poll(struct pollfd *ufds, unsigned int nfds, int timeout)
|
|||
|
||||
maxfd = -1;
|
||||
for (idx = 0; idx < nfds; ++idx) {
|
||||
ufds[idx].revents = 0;
|
||||
fd = ufds[idx].fd;
|
||||
if (ufds[idx].events) {
|
||||
if (fd > maxfd)
|
||||
maxfd = fd;
|
||||
if (fd > maxfd) {
|
||||
maxfd = fd;
|
||||
#ifdef MS_WINDOWS
|
||||
any_fds_set = 1;
|
||||
any_fds_set = 1;
|
||||
#endif
|
||||
}
|
||||
if (ufds[idx].events & POLLIN)
|
||||
|
@ -76,7 +76,6 @@ poll(struct pollfd *ufds, unsigned int nfds, int timeout)
|
|||
r = 0;
|
||||
for (idx = 0; idx < nfds; ++idx) {
|
||||
fd = ufds[idx].fd;
|
||||
ufds[idx].revents = 0;
|
||||
if (FD_ISSET(fd, &readfds))
|
||||
ufds[idx].revents |= POLLIN;
|
||||
if (FD_ISSET(fd, &writefds))
|
||||
|
|
Loading…
Add table
Reference in a new issue