- if (!io_new_conn(fd, start_idle, finish_idle, d))
- abort();
+ int fd2;
+
+ ok1(d->state == 0);
+ d->state++;
+ idler = conn;
+ io_set_finish(conn, finish_idle, d);
+
+ /* This will wake us up, as read will fail. */
+ fd2 = open("/dev/null", O_RDONLY);
+ ok1(fd2 >= 0);
+ io_set_finish(io_new_conn(NULL, fd2, init_waker, d), finish_waker, d);
+
+ return io_wait(conn, d, read_buf, d);