From 4fe4c9aa63a3ea17a7f4c6b22a33f269cf8dbd93 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 13 Mar 2020 19:50:34 +0100 Subject: [PATCH] vfs/pipe: trigger I/O-progress handler on EOF When the last writer closes the pipe, we must trigger the I/O progress handler to deliver the final EOF to the client (READ_OK with out count of 0). Fixes #3697 --- repos/gems/src/lib/vfs/pipe/plugin.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repos/gems/src/lib/vfs/pipe/plugin.cc b/repos/gems/src/lib/vfs/pipe/plugin.cc index 310198486..ffa0b282a 100644 --- a/repos/gems/src/lib/vfs/pipe/plugin.cc +++ b/repos/gems/src/lib/vfs/pipe/plugin.cc @@ -400,8 +400,13 @@ class Vfs_pipe::File_system : public Vfs::File_system Pipe *pipe = nullptr; if (Pipe_handle *handle = dynamic_cast(vfs_handle)) { pipe = &handle->pipe; - if (handle->writer) + if (handle->writer) { pipe->num_writers--; + + /* trigger reattempt of read to deliver EOF */ + if (pipe->num_writers == 0) + pipe->submit_signal(); + } } else if (New_pipe_handle *handle = dynamic_cast(vfs_handle)) pipe = &handle->pipe;