summaryrefslogtreecommitdiff
path: root/lib/libevent/kqueue.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-07-10 14:41:32 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-07-10 14:41:32 +0000
commitfaee96c925688d107f589335c6d6445ca57a1fba (patch)
treea3c93d352f475938515c9b976fb470a186858793 /lib/libevent/kqueue.c
parent9add69314b31cb5d7644bf137e22c49dbdf3a2b0 (diff)
Make EV_PERSIST work on EV_READ and EV_WRITE events.
provos@ ok.
Diffstat (limited to 'lib/libevent/kqueue.c')
-rw-r--r--lib/libevent/kqueue.c10
1 files changed, 7 insertions, 3 deletions
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 <provos@citi.umich.edu>
@@ -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)