]> git.ozlabs.org Git - ccan/blobdiff - ccan/io/test/run-08-hangup-on-idle.c
io: change io_idle() to io_wait()
[ccan] / ccan / io / test / run-08-hangup-on-idle.c
index b3840433410b7bfda4068293728c8050b2483856..c8257703d3333ef2a5199db85b7232022157102a 100644 (file)
@@ -15,6 +15,11 @@ static struct io_plan timeout_wakeup(struct io_conn *conn, char *buf)
        return io_read(buf, 16, io_close_cb, NULL);
 }
 
+static struct io_plan never(struct io_conn *conn, void *unused)
+{
+       abort();
+}
+
 int main(void)
 {
        int fds[2];
@@ -28,7 +33,7 @@ int main(void)
        /* Write then close. */
        io_new_conn(fds[1], io_write("hello there world", 16,
                                     io_close_cb, NULL));
-       conn = io_new_conn(fds[0], io_idle());
+       conn = io_new_conn(fds[0], io_wait(buf, never, NULL));
 
        /* To avoid assert(num_waiting) */
        ok1(pipe(fds2) == 0);