- /* This will wake us up. */
- fd = open("/dev/null", O_RDONLY);
- ok1(fd >= 0);
- ok1(io_new_conn(fd, start_waker, finish_waker, d));
-
- return io_idle();
-}
-
-static void finish_idle(struct io_conn *conn, struct data *d)
-{
- ok1(d->state == 4);
- d->state++;
- io_break(d, NULL, NULL);
-}
-
-static void init_conn(int fd, struct data *d)
-{
- if (!io_new_conn(fd, start_idle, finish_idle, d))
- abort();
+ /* This will wake us up, as read will fail. */
+ fd2 = open("/dev/null", O_RDONLY);
+ ok1(fd2 >= 0);
+ ok1(io_new_conn(fd2, io_read(idler, 1, NULL, NULL), finish_waker, d));