bug fix and potentital race condition from Alexander Drozdov

svn:r1025
This commit is contained in:
Niels Provos 2009-01-19 23:40:11 +00:00
parent f6eb1f816c
commit ed7e0e77ed
2 changed files with 6 additions and 1 deletions

View File

@ -390,8 +390,13 @@ event_reinit(struct event_base *base)
/* prevent internal delete */
if (base->sig.ev_signal_added) {
/* we cannot call event_del here because the base has
* not been reinitialized yet. */
event_queue_remove(base, &base->sig.ev_signal,
EVLIST_INSERTED);
if (base->sig.ev_signal.ev_flags & EVLIST_ACTIVE)
event_queue_remove(base, &base->sig.ev_signal,
EVLIST_ACTIVE);
base->sig.ev_signal_added = 0;
}

View File

@ -311,9 +311,9 @@ evsig_process(struct event_base *base)
ncalls = sig->evsigcaught[i];
if (ncalls == 0)
continue;
sig->evsigcaught[i] -= ncalls;
evmap_signal_active(base, i, ncalls);
sig->evsigcaught[i] = 0;
}
}