From: Nick Mathewson Date: Thu, 25 Feb 2010 21:57:57 +0000 (-0500) Subject: Fix mingw compilation X-Git-Tag: release-2.0.4-alpha~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23170a69f8f3394574652377e446604210d0c464;p=libevent Fix mingw compilation --- diff --git a/bufferevent_async.c b/bufferevent_async.c index 79600016..b43803f2 100644 --- a/bufferevent_async.c +++ b/bufferevent_async.c @@ -242,10 +242,10 @@ be_async_enable(struct bufferevent *buf, short what) return -1; /* NOTE: This interferes with non-blocking connect */ - if (event & EV_READ) - BEV_RESET_GENERIC_READ_TIMEOUT(bev); - if (event & EV_WRITE) - BEV_RESET_GENERIC_WRITE_TIMEOUT(bev); + if (what & EV_READ) + BEV_RESET_GENERIC_READ_TIMEOUT(buf); + if (what & EV_WRITE) + BEV_RESET_GENERIC_WRITE_TIMEOUT(buf); /* If we newly enable reading or writing, and we aren't reading or writing already, consider launching a new read or write. */ @@ -264,9 +264,9 @@ be_async_disable(struct bufferevent *bev, short what) * canceling any in-progress read or write operation, though it might * not work. */ - if (event & EV_READ) + if (what & EV_READ) BEV_DEL_GENERIC_READ_TIMEOUT(bev); - if (event & EV_WRITE) + if (what & EV_WRITE) BEV_DEL_GENERIC_WRITE_TIMEOUT(bev); return 0; diff --git a/event-internal.h b/event-internal.h index 840f180e..46dffa8f 100644 --- a/event-internal.h +++ b/event-internal.h @@ -223,7 +223,7 @@ struct event_config { }; /* Internal use only: Functions that might be missing from */ -#ifndef _EVENT_HAVE_TAILQFOREACH +#if defined(_EVENT_HAVE_SYS_QUEUE_H) && !defined(_EVENT_HAVE_TAILQFOREACH) #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_END(head) NULL #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)