diff options
author | Nicholas Marriott <@nicm> | 2015-12-27 02:15:03 +0300 |
---|---|---|
committer | Azat Khuzhin <a3at.mail@gmail.com> | 2015-12-27 02:51:43 +0300 |
commit | 88640aa1ca1d974dd4b301f9c496f417921af69b (patch) | |
tree | 103ab32c13c44acf9242a73b75f10c1b4856432d | |
parent | ad0c237bc0b2edd4f1dc0e82c6cffbde71bad78b (diff) | |
download | libevent-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
-rw-r--r-- | event.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |