]> granicus.if.org Git - libevent/commitdiff
Fix mingw compilation
authorNick Mathewson <nickm@torproject.org>
Thu, 25 Feb 2010 21:57:57 +0000 (16:57 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 25 Feb 2010 21:57:57 +0000 (16:57 -0500)
bufferevent_async.c
event-internal.h

index 7960001699222826a136b034d2ff35daf28c8bad..b43803f27a5a616efdf99855057a664687d2e2fd 100644 (file)
@@ -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;
index 840f180e86944c9529dc5a128728ef0493f757ba..46dffa8fd6f563a0310302e4e0d77e280d64fa2a 100644 (file)
@@ -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)