do not schedule kqueue events if we've reached the limit of changelist.

This commit is contained in:
Joris Vink 2013-06-20 23:29:26 +02:00
parent 25f1ab9865
commit c49622e4ae
1 changed files with 7 additions and 2 deletions

View File

@ -195,8 +195,13 @@ kore_event_wait(int quit)
void
kore_event_schedule(int fd, int type, int flags, void *data)
{
EV_SET(&changelist[nchanges], fd, type, flags, 0, 0, data);
nchanges++;
if (nchanges >= KQUEUE_EVENTS) {
kore_log(LOG_WARNING, "cannot schedule %d (%d) on %d",
type, flags, fd);
} else {
EV_SET(&changelist[nchanges], fd, type, flags, 0, 0, data);
nchanges++;
}
}
void