mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
If evsel->del() fails, don't leave the evmap in an inconsistent state.
This fixes assertion failures in cases where epoll() fails with EBADF -- the root cause for which is as of yet unknown. It seems something (OpenSSL?) is closing the file descriptor under our feet.
This commit is contained in:
parent
8ab612e396
commit
9b5a527f5b
8
evmap.c
8
evmap.c
@ -375,9 +375,11 @@ evmap_io_del_(struct event_base *base, evutil_socket_t fd, struct event *ev)
|
||||
|
||||
if (res) {
|
||||
void *extra = ((char*)ctx) + sizeof(struct evmap_io);
|
||||
if (evsel->del(base, ev->ev_fd, old, res, extra) == -1)
|
||||
return (-1);
|
||||
retval = 1;
|
||||
if (evsel->del(base, ev->ev_fd, old, res, extra) == -1) {
|
||||
retval = -1;
|
||||
} else {
|
||||
retval = 1;
|
||||
}
|
||||
}
|
||||
|
||||
ctx->nread = nread;
|
||||
|
Loading…
x
Reference in New Issue
Block a user