(trunk libevent) yes, more assertions for exiva

This commit is contained in:
Charles Kerr 2010-01-17 04:52:52 +00:00
parent 7062f7add3
commit c8fc84b971
2 changed files with 10 additions and 0 deletions

View File

@ -837,6 +837,7 @@ void
event_active(struct event *ev, int res, short ncalls)
{
assert(ev != NULL);
assert(ev->ev_base != NULL);
assert(res != 0);
/* We get different kinds of events, add them together */

View File

@ -288,6 +288,8 @@ kq_dispatch(struct event_base *base, void *arg, struct timeval *tv)
struct timespec ts, *ts_p = NULL;
int i, res;
assert(base != NULL);
if (tv != NULL) {
TIMEVAL_TO_TIMESPEC(tv, &ts);
ts_p = &ts;
@ -360,6 +362,10 @@ kq_dispatch(struct event_base *base, void *arg, struct timeval *tv)
}
} else {
ev = (struct event *)events[i].udata;
assert(ev != NULL);
assert(ev->ev_pri == 0);
assert(ev->base != NULL);
assert(ev->base == base);
if (!(ev->ev_events & EV_PERSIST))
ev->ev_flags &= ~EVLIST_X_KQINKERNEL;
@ -519,6 +525,9 @@ kq_del(void *arg, struct event *ev)
struct kevent kev, *kev_old;
struct kqidx *kqidx;
assert(ev != NULL);
assert(ev->ev_pri == 0);
changes_ok(kqop);
if (!(ev->ev_flags & EVLIST_X_KQINKERNEL))
return (0);