mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
Handle EBADF condition. yuck!
This commit is contained in:
parent
66df8c7271
commit
d60ba3dabf
1 changed files with 5 additions and 2 deletions
|
@ -204,7 +204,11 @@ comm_select(unsigned long delay)
|
|||
ep_event.data.ptr = F;
|
||||
|
||||
if(epoll_ctl(ep, EPOLL_CTL_DEL, F->fd, &ep_event) != 0) {
|
||||
libcharybdis_log("comm_select(): epoll_ctl failed while trying to delete a closed FD: %s", strerror(errno));
|
||||
/* XXX: we assume this is because close(2) has been called here. */
|
||||
if (errno == EBADF)
|
||||
continue;
|
||||
|
||||
libcharybdis_log("comm_select(): epoll_ctl failed while trying to delete an FD marked as closed: %s", strerror(errno));
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
@ -238,4 +242,3 @@ comm_select(unsigned long delay)
|
|||
}
|
||||
return COMM_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue