summaryrefslogtreecommitdiffstats
path: root/lib/libevent
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2010-08-30 07:54:29 +0000
committernicm <nicm@openbsd.org>2010-08-30 07:54:29 +0000
commit3e74c2802c4643de231904a6b64de27bffbf54f3 (patch)
tree2074fbe7f9840d0a074e722d4079a65c91ab5b38 /lib/libevent
parentAdd missing network service name from /var/log/ftpd entries. (diff)
downloadwireguard-openbsd-3e74c2802c4643de231904a6b64de27bffbf54f3.tar.xz
wireguard-openbsd-3e74c2802c4643de231904a6b64de27bffbf54f3.zip
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/libevent')
-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);