Catch EBADF in async

This commit is contained in:
2023-01-05 22:04:18 +01:00
parent 4782707049
commit c7be0adc66

View File

@ -256,9 +256,14 @@ void async_thread(void) {
evt_listen_t *evt = events[i].data.ptr;
if (async_exec(evt, async_e2a(events[i].events)) == 0) {
if (epoll_ctl(epoll_fd, EPOLL_CTL_DEL, evt->fd, NULL) == -1) {
if (errno == EBADF) {
// already closed fd, do not die
errno = 0;
} else {
critical("Unable to remove file descriptor from epoll instance");
return;
}
}
local = list_delete(local, &evt);
if (local == NULL) {