fix events
This commit is contained in:
parent
92bed5d520
commit
3275afd34c
6
event.c
6
event.c
@ -221,7 +221,7 @@ int event_loop(void)
|
|||||||
continue;
|
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)
|
if (cmp_timeval(&entry->nextrun, &now) == -1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -265,7 +265,6 @@ int event_loop(void)
|
|||||||
FD_ZERO(readfds);
|
FD_ZERO(readfds);
|
||||||
}
|
}
|
||||||
FD_SET(entry->fd, readfds);
|
FD_SET(entry->fd, readfds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry->flags & FD_WRITE) {
|
if (entry->flags & FD_WRITE) {
|
||||||
@ -285,8 +284,8 @@ int event_loop(void)
|
|||||||
* after an error.
|
* after an error.
|
||||||
*/
|
*/
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
list_for_each_entry(entry, &event_fd_list, list) {
|
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->flags & (FD_READ | EVENT_NEW)) == FD_READ) && FD_ISSET(entry->fd, readfds))
|
||||||
if (entry->read_cb(entry->fd, entry->read_priv) != 0)
|
if (entry->read_cb(entry->fd, entry->read_priv) != 0)
|
||||||
@ -297,6 +296,5 @@ int event_loop(void)
|
|||||||
entry->flags |= EVENT_DELETE;
|
entry->flags |= EVENT_DELETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
free(fdsets);
|
free(fdsets);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user