From 261b10869ddbb4ac650ef8886c5052b1a8dbeecd Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 12 Oct 2017 17:03:09 +1030 Subject: [PATCH] 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 --- ccan/io/io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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) -- 2.39.2