]> granicus.if.org Git - libevent/commitdiff
treate EINVAL as per fd error in kqueue; use argument for debug macros in
authorNiels Provos <provos@gmail.com>
Sat, 11 Jun 2005 21:15:22 +0000 (21:15 +0000)
committerNiels Provos <provos@gmail.com>
Sat, 11 Jun 2005 21:15:22 +0000 (21:15 +0000)
poll; version 1.1a; EINVAL fix from Nick Mathewson

svn:r168

configure.in
kqueue.c
poll.c

index 1a2af825d91b65a40912d3a6937a945f5806d9ad..b75d2d66b89f331e0b53e611b056e4d4ac690c1b 100644 (file)
@@ -2,7 +2,7 @@ dnl configure.in for libevent
 dnl Dug Song <dugsong@monkey.org>
 AC_INIT(event.c)
 
-AM_INIT_AUTOMAKE(libevent,1.0f)
+AM_INIT_AUTOMAKE(libevent,1.1a)
 AM_CONFIG_HEADER(config.h)
 AM_MAINTAINER_MODE
 
index 4a8991d4c650a565c6d7aedb473620b150ab3da8..3bc6c2db501c3f36bc3d2c4c85cf52b1fbf40042 100644 (file)
--- a/kqueue.c
+++ b/kqueue.c
@@ -239,11 +239,14 @@ kq_dispatch(struct event_base *base, void *arg, struct timeval *tv)
                         *   closed,
                         *   ENOENT when the file discriptor was closed and
                         *   then reopened.
+                        *   EINVAL for some reasons not understood; EINVAL
+                        *   should not be returned ever; but FreeBSD does :-\
                         * An error is also indicated when a callback deletes
                         * an event we are still processing.  In that case
                         * the data field is set to ENOENT.
                         */
                        if (events[i].data == EBADF ||
+                           events[i].data == EINVAL ||
                            events[i].data == ENOENT)
                                continue;
                        errno = events[i].data;
diff --git a/poll.c b/poll.c
index 1ffd40cf40fa4c4132d80567f416602382d7add0..da35b20afab6d5c96c464697dfec450eaadfc9e9 100644 (file)
--- a/poll.c
+++ b/poll.c
@@ -157,7 +157,7 @@ poll_dispatch(struct event_base *base, void *arg, struct timeval *tv)
        if (evsignal_deliver(&pop->evsigmask) == -1)
                return (-1);
 
-       poll_check_ok();
+       poll_check_ok(pop);
        sec = tv->tv_sec * 1000 + (tv->tv_usec + 999) / 1000;
        nfds = pop->nfds;
        res = poll(pop->event_set, nfds, sec);