|
From: Nick M. <ni...@us...> - 2010-02-25 22:15:27
|
Author: Nick Mathewson <ni...@to...>
Date: Thu, 25 Feb 2010 16:57:57 -0500
Subject: Fix mingw compilation
Commit: 23170a69f8f3394574652377e446604210d0c464
---
bufferevent_async.c | 12 ++++++------
event-internal.h | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/bufferevent_async.c b/bufferevent_async.c
index 7960001..b43803f 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 840f180..46dffa8 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 <sys/queue.h> */
-#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)
--
1.6.3
|