evpoll: Don't try to be more smart than g_poll

gpoll.c:g_poll maps G_IO_PRI (which is POLLPRI) to the errorfds of
the select call. Let's do the same.

Change-Id: I8c9163f7495e0b237bde2d48beffea3b0776a1dd
Related: OS#1934
This commit is contained in:
Holger Hans Peter Freyther 2017-02-11 13:06:32 +07:00
parent e19f9ce39f
commit 42b073a233
1 changed files with 4 additions and 4 deletions

View File

@ -43,15 +43,15 @@ int evpoll(struct pollfd *fds, nfds_t nfds, int timeout)
for (i = 0; i < nfds; ++i) { for (i = 0; i < nfds; ++i) {
if (fds[i].fd < 0) if (fds[i].fd < 0)
continue; continue;
if ((fds[i].events & (POLLIN | POLLOUT | POLLERR)) == 0) if ((fds[i].events & (POLLIN | POLLOUT | POLLPRI)) == 0)
continue; continue;
/* copy events, glib seems to map POLLPRI to exceptionset? */ /* copy events. Not sure why glib maps PRI to exceptionset */
if (fds[i].events & POLLIN) if (fds[i].events & POLLIN)
FD_SET(fds[i].fd, &readset); FD_SET(fds[i].fd, &readset);
if (fds[i].events & POLLOUT) if (fds[i].events & POLLOUT)
FD_SET(fds[i].fd, &writeset); FD_SET(fds[i].fd, &writeset);
if (fds[i].events & POLLERR) if (fds[i].events & POLLPRI)
FD_SET(fds[i].fd, &exceptset); FD_SET(fds[i].fd, &exceptset);
if (fds[i].fd > maxfd) if (fds[i].fd > maxfd)
@ -102,7 +102,7 @@ int evpoll(struct pollfd *fds, nfds_t nfds, int timeout)
if (FD_ISSET(fds[i].fd, &writeset)) if (FD_ISSET(fds[i].fd, &writeset))
fds[i].revents |= POLLOUT; fds[i].revents |= POLLOUT;
if (FD_ISSET(fds[i].fd, &exceptset)) if (FD_ISSET(fds[i].fd, &exceptset))
fds[i].revents |= POLLERR; fds[i].revents |= POLLPRI;
} }
return rc; return rc;