From 42b073a233740e0e0125e99e4bea29ac7d3d27ed Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 11 Feb 2017 13:06:32 +0700 Subject: [PATCH] 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 --- src/evpoll.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/evpoll.c b/src/evpoll.c index a4b8a80..3273bd0 100644 --- a/src/evpoll.c +++ b/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;