From faee96c925688d107f589335c6d6445ca57a1fba Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Wed, 10 Jul 2002 14:41:32 +0000 Subject: Make EV_PERSIST work on EV_READ and EV_WRITE events. provos@ ok. --- lib/libevent/kqueue.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/libevent/kqueue.c') diff --git a/lib/libevent/kqueue.c b/lib/libevent/kqueue.c index 2985daa6f0b..fa106d4dd1f 100644 --- a/lib/libevent/kqueue.c +++ b/lib/libevent/kqueue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kqueue.c,v 1.4 2002/06/25 15:50:15 mickey Exp $ */ +/* $OpenBSD: kqueue.c,v 1.5 2002/07/10 14:41:31 art Exp $ */ /* * Copyright 2000-2002 Niels Provos @@ -295,7 +295,9 @@ kq_add(void *arg, struct event *ev) memset(&kev, 0, sizeof(kev)); kev.ident = ev->ev_fd; kev.filter = EVFILT_READ; - kev.flags = EV_ADD | EV_ONESHOT; + kev.flags = EV_ADD; + if (!(ev->ev_events & EV_PERSIST)) + kev.filter |= EV_ONESHOT; kev.udata = ev; if (kq_insert(kqop, &kev) == -1) @@ -308,7 +310,9 @@ kq_add(void *arg, struct event *ev) memset(&kev, 0, sizeof(kev)); kev.ident = ev->ev_fd; kev.filter = EVFILT_WRITE; - kev.flags = EV_ADD | EV_ONESHOT; + kev.flags = EV_ADD; + if (!(ev->ev_events & EV_PERSIST)) + kev.filter |= EV_ONESHOT; kev.udata = ev; if (kq_insert(kqop, &kev) == -1) -- cgit v1.2.3