return true;
}
-struct io_plan *io_close_taken_fd(struct io_conn *conn)
+void cleanup_conn_without_close(struct io_conn *conn)
{
tal_del_destructor(conn, destroy_conn_close_fd);
destroy_conn(conn, false);
- return io_close(conn);
}
static void accept_conn(struct io_listener *l)
break;
if (fds[i]->listener) {
+ struct io_listener *l = (void *)fds[i];
if (events & POLLIN) {
- accept_conn((void *)c);
+ accept_conn(l);
r--;
+ } else if (events & (POLLHUP|POLLNVAL|POLLERR)) {
+ r--;
+ errno = EBADF;
+ io_close_listener(l);
}
} else if (events & (POLLIN|POLLOUT)) {
r--;