fix events

This commit is contained in:
Olaf Rempel 2007-07-14 15:40:03 +02:00
parent 92bed5d520
commit 3275afd34c

View File

@ -221,7 +221,7 @@ int event_loop(void)
continue;
}
/* timeout not elapsed, exit search (since list is sorted) */
/* first timeout not elapsed, exit search (since list is sorted) */
if (cmp_timeval(&entry->nextrun, &now) == -1)
break;
@ -265,7 +265,6 @@ int event_loop(void)
FD_ZERO(readfds);
}
FD_SET(entry->fd, readfds);
}
if (entry->flags & FD_WRITE) {
@ -285,8 +284,8 @@ int event_loop(void)
* after an error.
*/
continue;
}
} else {
list_for_each_entry(entry, &event_fd_list, list) {
if (((entry->flags & (FD_READ | EVENT_NEW)) == FD_READ) && FD_ISSET(entry->fd, readfds))
if (entry->read_cb(entry->fd, entry->read_priv) != 0)
@ -297,6 +296,5 @@ int event_loop(void)
entry->flags |= EVENT_DELETE;
}
}
}
free(fdsets);
}