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. */
* 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;
};
/* 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)