Merge branch 'io'
[ccan] / ccan / io / test / run-03-readpartial.c
index 5e08b1a2709347af6131af10c54692f5edeaf2d9..7ecccc7412cd2aa3f2b5342614a695168e5e46d9 100644 (file)
@@ -29,9 +29,9 @@ static void init_conn(int fd, struct data *d)
        d->state++;
        d->bytes = sizeof(d->buf);
 
-       if (!io_new_conn(fd, io_read_partial(d->buf, &d->bytes, io_close, d),
-                        finish_ok, d))
-               abort();
+       io_set_finish(io_new_conn(fd,
+                                 io_read_partial(d->buf, &d->bytes, io_close_cb, d)),
+                     finish_ok, d);
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)