X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fio%2Fbenchmarks%2Frun-loop.c;h=ef01cf6a94663597dec0b4f7d0fe63bbe9c02f7a;hb=5a510ed5696255910fd42adb47d7c1ffa728a116;hp=b0e6b02c804fec579ed2d6019b3d266f993aeb7e;hpb=57d9d1be33905691ec756b14b066181ca6850ced;p=ccan diff --git a/ccan/io/benchmarks/run-loop.c b/ccan/io/benchmarks/run-loop.c index b0e6b02c..ef01cf6a 100644 --- a/ccan/io/benchmarks/run-loop.c +++ b/ccan/io/benchmarks/run-loop.c @@ -23,7 +23,7 @@ static struct io_plan poke_writer(struct io_conn *conn, struct buffer *buf) assert(conn == buf->reader); if (buf->iters == NUM_ITERS) - return io_close(conn, NULL); + return io_close(); /* You write. */ io_wake(buf->writer, @@ -41,7 +41,7 @@ static struct io_plan poke_reader(struct io_conn *conn, struct buffer *buf) io_read(&buf->buf, sizeof(buf->buf), poke_writer, buf)); if (++buf->iters == NUM_ITERS) - return io_close(conn, NULL); + return io_close(); /* I'll wait until you tell me to write. */ return io_idle(); @@ -66,14 +66,13 @@ int main(void) memset(buf[i].buf, i, sizeof(buf[i].buf)); sprintf(buf[i].buf, "%i-%i", i, i); - buf[i].reader = io_new_conn(last_read, io_idle(), NULL, NULL); + buf[i].reader = io_new_conn(last_read, io_idle()); if (!buf[i].reader) err(1, "Creating reader %i", i); buf[i].writer = io_new_conn(fds[1], io_write(&buf[i].buf, sizeof(buf[i].buf), - poke_reader, &buf[i]), - NULL, NULL); + poke_reader, &buf[i])); if (!buf[i].writer) err(1, "Creating writer %i", i); last_read = fds[0]; @@ -83,13 +82,12 @@ int main(void) i = 0; buf[i].iters = 0; sprintf(buf[i].buf, "%i-%i", i, i); - buf[i].reader = io_new_conn(last_read, io_idle(), NULL, NULL); + buf[i].reader = io_new_conn(last_read, io_idle()); if (!buf[i].reader) err(1, "Creating reader %i", i); buf[i].writer = io_new_conn(last_write, io_write(&buf[i].buf, sizeof(buf[i].buf), - poke_reader, &buf[i]), - NULL, NULL); + poke_reader, &buf[i])); if (!buf[i].writer) err(1, "Creating writer %i", i);