Commit 261b1086 authored by Rusty Russell's avatar Rusty Russell

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: default avatarRusty Russell <rusty@rustcorp.com.au>
parent e2e70f55
...@@ -399,8 +399,7 @@ void io_ready(struct io_conn *conn, int pollflags) ...@@ -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 /* 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! */ * read to fail if we're duplex: we want to drain it! */
do_plan(conn, &conn->plan[IO_OUT], do_plan(conn, &conn->plan[IO_OUT],
(conn->plan[IO_IN].status == IO_POLLING conn->plan[IO_IN].status == IO_POLLING);
|| conn->plan[IO_IN].status == IO_ALWAYS));
} }
void io_do_always(struct io_conn *conn) void io_do_always(struct io_conn *conn)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment