vfs/pipe: never report read_ready on pipe/out handle

This commit is contained in:
Christian Helmuth
2020-07-23 14:10:13 +02:00
parent e44ffa02c9
commit 18b26ff595

View File

@ -247,13 +247,13 @@ Vfs_pipe::Pipe_handle::read(char *buf,
bool bool
Vfs_pipe::Pipe_handle::read_ready() { Vfs_pipe::Pipe_handle::read_ready() {
return !pipe.buffer.empty(); } return !writer && !pipe.buffer.empty(); }
bool bool
Vfs_pipe::Pipe_handle::notify_read_ready() Vfs_pipe::Pipe_handle::notify_read_ready()
{ {
if (!read_ready_elem.enqueued()) if (!writer && !read_ready_elem.enqueued())
pipe.read_ready_waiters.enqueue(read_ready_elem); pipe.read_ready_waiters.enqueue(read_ready_elem);
return true; return true;
} }