From 9938aaf5114110c60a8a4f59866be3de5cd88c48 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Sat, 11 Jun 2005 21:15:22 +0000 Subject: [PATCH] treate EINVAL as per fd error in kqueue; use argument for debug macros in poll; version 1.1a; EINVAL fix from Nick Mathewson svn:r168 --- configure.in | 2 +- kqueue.c | 3 +++ poll.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 1a2af825..b75d2d66 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl configure.in for libevent dnl Dug Song AC_INIT(event.c) -AM_INIT_AUTOMAKE(libevent,1.0f) +AM_INIT_AUTOMAKE(libevent,1.1a) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/kqueue.c b/kqueue.c index 4a8991d4..3bc6c2db 100644 --- 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 1ffd40cf..da35b20a 100644 --- 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); -- 2.40.0