]> git.ozlabs.org Git - ccan/blobdiff - ccan/io/test/run-13-all-idle.c
ccan/io: implement timeouts.
[ccan] / ccan / io / test / run-13-all-idle.c
index 0e7e1565d579fa56b76397dcf05107c12611f63e..7896b14f4e036913f2ae67feca4f3903e580b024 100644 (file)
@@ -7,6 +7,11 @@
 #include <stdio.h>
 #include <signal.h>
 
+static struct io_plan *setup_waiter(struct io_conn *conn, int *status)
+{
+       return io_wait(conn, status, io_close_cb, NULL);
+}
+
 int main(void)
 {
        int status;
@@ -17,8 +22,8 @@ int main(void)
                int fds[2];
 
                ok1(pipe(fds) == 0);
-               io_new_conn(fds[0], io_idle());
-               io_loop();
+               io_new_conn(NULL, fds[0], setup_waiter, &status);
+               io_loop(NULL, NULL);
                exit(1);
        }