mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-11 13:22:33 +00:00
libc: only return requested events in poll()
Even if the underlying select() reports events, only report those to the caller that were initially requested.
This commit is contained in:
parent
22687bb10b
commit
028aeafabe
@ -89,10 +89,10 @@ poll(struct pollfd fds[], nfds_t nfds, int timeout)
|
||||
fds[i].revents = 0;
|
||||
if (fd == -1)
|
||||
continue;
|
||||
if (FD_ISSET(fd, &readfds)) {
|
||||
if ((fds[i].events & POLLIN) && FD_ISSET(fd, &readfds)) {
|
||||
fds[i].revents |= POLLIN;
|
||||
}
|
||||
if (FD_ISSET(fd, &writefds)) {
|
||||
if ((fds[i].events & POLLOUT) && FD_ISSET(fd, &writefds)) {
|
||||
fds[i].revents |= POLLOUT;
|
||||
}
|
||||
if (FD_ISSET(fd, &exceptfds)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user