for (; io != NULL && ret > 0; io = ioloop->next_io_file) {
ioloop->next_io_file = io->next;
+ if (io->fd == -1) {
+ /* io_add_istream() without fd */
+ continue;
+ }
pollfd = &ctx->fds[ctx->fd_index[io->fd]];
if (pollfd->revents != 0) {
if (pollfd->revents & POLLNVAL) {
for (; io != NULL && ret > 0; io = ioloop->next_io_file) {
ioloop->next_io_file = io->next;
- if (io_check_condition(ctx, io->fd, io->io.condition)) {
+ if (io->fd == -1) {
+ /* io_add_istream() without fd */
+ } else if (io_check_condition(ctx, io->fd, io->io.condition)) {
ret--;
io_loop_call_io(&io->io);
}