commit - 12d24edabcafcd71848612b2bc09a5ceeff5ef36
commit + e3693ed949ccfcad6170d85b2db9e86499e1fc52
blob - bf96e297be5f68bf342f346359d4255291accf9f
blob + 8319888390074988e37923f81927ba6444f75144
--- bufio.c
+++ bufio.c
#include <assert.h>
#include <errno.h>
-#include <poll.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include "bufio.h"
+#include "ev.h" /* for EV_* flags */
int
buf_init(struct buf *buf)
return (0);
}
-short
-bufio_pollev(struct bufio *bio)
+int
+bufio_ev(struct bufio *bio)
{
short ev;
if (bio->pflags)
return (bio->pflags);
- ev = POLLIN;
+ ev = EV_READ;
if (bio->wbuf.len != 0)
- ev |= POLLOUT;
+ ev |= EV_WRITE;
return (ev);
}
switch (r) {
case TLS_WANT_POLLIN:
case TLS_WANT_POLLOUT:
- bio->pflags = POLLIN | POLLOUT;
+ bio->pflags = EV_READ | EV_WRITE;
errno = EAGAIN;
return (-1);
case -1:
switch (w = tls_write(bio->ctx, wbuf->buf, wbuf->len)) {
case TLS_WANT_POLLIN:
case TLS_WANT_POLLOUT:
- bio->pflags = POLLIN | POLLOUT;
+ bio->pflags = EV_WRITE | EV_READ;
errno = EAGAIN;
return (-1);
case -1: