Small correction to poll semantics
This commit is contained in:
parent
8b5246b038
commit
5ee96e0271
1 changed files with 4 additions and 0 deletions
|
@ -196,12 +196,16 @@ static bool checkForPoll(std::vector<FakeSocketPair>& fds, struct pollfd *pollfd
|
|||
if (pollfds[i].fd < 0 || pollfds[i].fd/2 >= fds.size())
|
||||
{
|
||||
pollfds[i].revents = POLLNVAL;
|
||||
retval = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
const int K = ((pollfds[i].fd)&1);
|
||||
if (fds[pollfds[i].fd/2].fd[K] == -1)
|
||||
{
|
||||
pollfds[i].revents = POLLNVAL;
|
||||
retval = true;
|
||||
}
|
||||
else
|
||||
pollfds[i].revents = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue