From: Nicholas Marriott <@nicm> Date: Sat, 26 Dec 2015 23:15:03 +0000 (+0300) Subject: event_reinit: make signals works after fork() without evsig_add() X-Git-Tag: release-2.1.6-beta~87^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88640aa;p=libevent 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 --- 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