X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fio%2Ftest%2Frun-08-hangup-on-idle.c;h=c8257703d3333ef2a5199db85b7232022157102a;hb=12e924346b342c61219a3fdc57eb6b00a27f1cd1;hp=b3840433410b7bfda4068293728c8050b2483856;hpb=641b511049e5c03d45ada0c3fd829691b173e5d1;p=ccan diff --git a/ccan/io/test/run-08-hangup-on-idle.c b/ccan/io/test/run-08-hangup-on-idle.c index b3840433..c8257703 100644 --- a/ccan/io/test/run-08-hangup-on-idle.c +++ b/ccan/io/test/run-08-hangup-on-idle.c @@ -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);