Revert "io: closing one side of a duplex connection closes both."
[ccan] / ccan / io / test / run-02-read.c
index b8c93c36209dd1a81a40a5049d4b13725cb39e7e..c7a7eaf1c338704ad42cbcd3c6f7796377521134 100644 (file)
@@ -27,9 +27,9 @@ static void init_conn(int fd, struct data *d)
        ok1(d->state == 0);
        d->state++;
 
-       if (!io_new_conn(fd, io_read(d->buf, sizeof(d->buf), io_close, d),
-                        finish_ok, d))
-               abort();
+       io_set_finish(io_new_conn(fd,
+                                 io_read(d->buf, sizeof(d->buf), io_close_cb, d)),
+                     finish_ok, d);
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)