summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-08-30 07:54:30 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-08-30 07:54:30 +0000
commitebf860fb8fb6a49adf0e288e5b3ef41376fffda6 (patch)
treee3053dd23a648c2b076919c8dffd61f4f1b6bada /lib
parent3faf306764150710b3084c81cb2ee0dffca4815b (diff)
Fix from upstream to make all backends reinit on event_reinit(). This
was not being done for poll and select, so after fork they would remain using the same socketpair for signal notification, leading to a race between the two processes to read from it and hangs. Problem originally reported by kili@. ok gilles
Diffstat (limited to 'lib')
-rw-r--r--lib/libevent/event.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libevent/event.c b/lib/libevent/event.c
index 5bca0683815..81f8a97a8f4 100644
--- a/lib/libevent/event.c
+++ b/lib/libevent/event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: event.c,v 1.24 2010/07/12 18:03:38 nicm Exp $ */
+/* $OpenBSD: event.c,v 1.25 2010/08/30 07:54:29 nicm Exp $ */
/*
* Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu>
@@ -281,9 +281,14 @@ event_reinit(struct event_base *base)
int res = 0;
struct event *ev;
+#if 0
+ /* Right now, reinit always takes effect, since even if the
+ backend doesn't require it, the signal socketpair code does.
+ */
/* check if this event mechanism requires reinit */
if (!evsel->need_reinit)
return (0);
+#endif
/* prevent internal delete */
if (base->sig.ev_signal_added) {
@@ -296,7 +301,7 @@ event_reinit(struct event_base *base)
EVLIST_ACTIVE);
base->sig.ev_signal_added = 0;
}
-
+
if (base->evsel->dealloc != NULL)
base->evsel->dealloc(base, base->evbase);
evbase = base->evbase = evsel->init(base);