call epoll_ctl after changing our state table; in case that epoll_ctl fails

we need to make sure that the table is consistent. from William Ahern


svn:r162
This commit is contained in:
Niels Provos 2005-05-10 08:14:39 +00:00
parent c15db0349a
commit cdcfae7fc1

View File

@ -333,13 +333,13 @@ epoll_del(void *arg, struct event *ev)
epev.events = events;
epev.data.ptr = evep;
if (epoll_ctl(epollop->epfd, op, fd, &epev) == -1)
return (-1);
if (needreaddelete)
evep->evread = NULL;
if (needwritedelete)
evep->evwrite = NULL;
if (epoll_ctl(epollop->epfd, op, fd, &epev) == -1)
return (-1);
return (0);
}