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
This commit is contained in:
Nicholas Marriott 2015-12-27 02:15:03 +03:00 committed by Azat Khuzhin
parent ad0c237bc0
commit 88640aa1ca

View File

@ -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