summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2007-02-13 20:10:58 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2007-02-13 20:10:58 +0000
commit0c2863560d010a645ec33542ab66148efc2f657d (patch)
treed2a385afdc8480df2179401660b0928a58a6b07a /lib
parentc353cba0ce0d9fed36f58bc37c67e0c0917c9dcb (diff)
Avoid double recacl when loop_once is used.
From libevent SVN via brad@.
Diffstat (limited to 'lib')
-rw-r--r--lib/libevent/event.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/libevent/event.c b/lib/libevent/event.c
index 7012da54447..cffcd7f961c 100644
--- a/lib/libevent/event.c
+++ b/lib/libevent/event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: event.c,v 1.15 2007/02/04 18:59:12 millert Exp $ */
+/* $OpenBSD: event.c,v 1.16 2007/02/13 20:10:57 millert Exp $ */
/*
* Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu>
@@ -364,12 +364,12 @@ event_base_loop(struct event_base *base, int flags)
struct timeval tv;
int res, done;
- /* Calculate the initial events that we are waiting for */
- if (evsel->recalc(base, evbase, 0) == -1)
- return (-1);
-
done = 0;
while (!done) {
+ /* Calculate the initial events that we are waiting for */
+ if (evsel->recalc(base, evbase, 0) == -1)
+ return (-1);
+
/* Terminate the loop if we have been asked to */
if (base->event_gotterm) {
base->event_gotterm = 0;
@@ -423,9 +423,6 @@ event_base_loop(struct event_base *base, int flags)
done = 1;
} else if (flags & EVLOOP_NONBLOCK)
done = 1;
-
- if (evsel->recalc(base, evbase, 0) == -1)
- return (-1);
}
event_debug(("%s: asked to terminate loop.", __func__));