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
changes/97/1797/1
Holger Hans Peter Freyther 6 years ago
parent e19f9ce39f
commit 42b073a233
  1. 8
      src/evpoll.c

@ -43,15 +43,15 @@ int evpoll(struct pollfd *fds, nfds_t nfds, int timeout)
for (i = 0; i < nfds; ++i) {
if (fds[i].fd < 0)
continue;
if ((fds[i].events & (POLLIN | POLLOUT | POLLERR)) == 0)
if ((fds[i].events & (POLLIN | POLLOUT | POLLPRI)) == 0)
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)
FD_SET(fds[i].fd, &readset);
if (fds[i].events & POLLOUT)
FD_SET(fds[i].fd, &writeset);
if (fds[i].events & POLLERR)
if (fds[i].events & POLLPRI)
FD_SET(fds[i].fd, &exceptset);
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))
fds[i].revents |= POLLOUT;
if (FD_ISSET(fds[i].fd, &exceptset))
fds[i].revents |= POLLERR;
fds[i].revents |= POLLPRI;
}
return rc;

Loading…
Cancel
Save