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())
|
if (pollfds[i].fd < 0 || pollfds[i].fd/2 >= fds.size())
|
||||||
{
|
{
|
||||||
pollfds[i].revents = POLLNVAL;
|
pollfds[i].revents = POLLNVAL;
|
||||||
|
retval = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const int K = ((pollfds[i].fd)&1);
|
const int K = ((pollfds[i].fd)&1);
|
||||||
if (fds[pollfds[i].fd/2].fd[K] == -1)
|
if (fds[pollfds[i].fd/2].fd[K] == -1)
|
||||||
|
{
|
||||||
pollfds[i].revents = POLLNVAL;
|
pollfds[i].revents = POLLNVAL;
|
||||||
|
retval = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
pollfds[i].revents = 0;
|
pollfds[i].revents = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue