summaryrefslogtreecommitdiff
path: root/event.c
diff options
context:
space:
mode:
authorNicholas Marriott <@nicm>2015-12-27 02:15:03 +0300
committerAzat Khuzhin <a3at.mail@gmail.com>2015-12-27 02:51:43 +0300
commit88640aa1ca1d974dd4b301f9c496f417921af69b (patch)
tree103ab32c13c44acf9242a73b75f10c1b4856432d /event.c
parentad0c237bc0b2edd4f1dc0e82c6cffbde71bad78b (diff)
downloadlibevent-88640aa1ca1d974dd4b301f9c496f417921af69b.tar.gz
event_reinit: make signals works after fork() without evsig_add()
event_reinit() removes the event, but only evsig_add puts it back. So any signals set up before event_reinit will be ignored until another signal is added. Fixes: #307
Diffstat (limited to 'event.c')
-rw-r--r--event.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/event.c b/event.c
index 082d292f..503003e2 100644
--- a/event.c
+++ b/event.c
@@ -1025,6 +1025,11 @@ event_reinit(struct event_base *base)
res = -1;
} else {
res = evsig_init_(base);
+ if (res == 0 && had_signal_added) {
+ res = event_add_nolock_(&base->sig.ev_signal, NULL, 0);
+ if (res == 0)
+ base->sig.ev_signal_added = 1;
+ }
}
/* If we were notifiable before, and nothing just exploded, become