mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
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:
parent
ad0c237bc0
commit
88640aa1ca
5
event.c
5
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user