From: Bernhard Froehlich Date: Fri, 31 May 2013 09:48:40 +0000 (+0200) Subject: tvhpoll: Fix kqueue parts of the poll wrapper API X-Git-Tag: v3.9~46^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2ef8e9c94d445aa50c1848ca6ad2be3f3a62120;p=thirdparty%2Ftvheadend.git tvhpoll: Fix kqueue parts of the poll wrapper API --- diff --git a/src/tvhpoll.c b/src/tvhpoll.c index 6b7e92df0..cd9852228 100644 --- a/src/tvhpoll.c +++ b/src/tvhpoll.c @@ -16,7 +16,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#define ENABLE_EPOLL 1 #include "tvheadend.h" #include "tvhpoll.h" @@ -29,6 +28,7 @@ #if ENABLE_EPOLL #include #elif ENABLE_KQUEUE +#include #include #include #endif @@ -118,8 +118,9 @@ int tvhpoll_add uint32_t fflags; tvhpoll_alloc(tp, num); for (i = 0; i < num; i++) { - if (evs[i] & TVHPOLL_OUT) fflags |= EVFILT_WRITE; - if (evs[i] & TVHPOLL_IN) fflags |= EVFILT_READ; + fflags = 0; + if (evs[i].events & TVHPOLL_OUT) fflags |= EVFILT_WRITE; + if (evs[i].events & TVHPOLL_IN) fflags |= EVFILT_READ; EV_SET(tp->ev+i, evs[i].fd, fflags, EV_ADD, 0, 0, NULL); } kevent(tp->fd, tp->ev, num, NULL, 0, NULL); @@ -139,7 +140,7 @@ int tvhpoll_rem #elif ENABLE_KQUEUE int i; for (i = 0; i < num; i++) - EV_SET(tp->ev+i, evs[i].fd, 0, EV_DEL, 0, 0, NULL); + EV_SET(tp->ev+i, evs[i].fd, 0, EV_DELETE, 0, 0, NULL); kevent(tp->fd, tp->ev, num, NULL, 0, NULL); #else #endif @@ -172,8 +173,8 @@ int tvhpoll_wait for (i = 0; i < nfds; i++) { evs[i].fd = tp->ev[i].ident; evs[i].events = 0; - if (tp->ev[i].ffilt & EVFILT_WRITE) evs[i].events |= TVHPOLL_OUT; - if (tp->ev[i].ffilt & EVFILT_READ) evs[i].events |= TVHPOLL_IN; + if (tp->ev[i].fflags & EVFILT_WRITE) evs[i].events |= TVHPOLL_OUT; + if (tp->ev[i].fflags & EVFILT_READ) evs[i].events |= TVHPOLL_IN; } #else #endif