From: Rusty Russell Date: Thu, 12 Oct 2017 06:33:09 +0000 (+1030) Subject: io: fix corner case in EPIPE handling. X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=261b10869ddbb4ac650ef8886c5052b1a8dbeecd;ds=sidebyside io: fix corner case in EPIPE handling. If io_read is always called, we don't know that it will actually read, so it might not notice error. In that case, safest to fail immediately. Signed-off-by: Rusty Russell --- diff --git a/ccan/io/io.c b/ccan/io/io.c index 7eea9c35..99f0f7c9 100644 --- a/ccan/io/io.c +++ b/ccan/io/io.c @@ -399,8 +399,7 @@ void io_ready(struct io_conn *conn, int pollflags) /* If we're writing to a closed pipe, we need to wait for * read to fail if we're duplex: we want to drain it! */ do_plan(conn, &conn->plan[IO_OUT], - (conn->plan[IO_IN].status == IO_POLLING - || conn->plan[IO_IN].status == IO_ALWAYS)); + conn->plan[IO_IN].status == IO_POLLING); } void io_do_always(struct io_conn *conn)