X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fio%2Ftest%2Frun-08-hangup-on-idle.c;h=c8257703d3333ef2a5199db85b7232022157102a;hp=b3840433410b7bfda4068293728c8050b2483856;hb=f7ab2c65d40839a327e50876dc2708ab7b11aa52;hpb=cdf62dce7077a9f9a818edbb67d31d033cbb73c6 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);