From bac3219a01007b4d21556c21f515b6b58e5f9cf7 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 10 Aug 2024 18:16:27 +0300 Subject: [PATCH] Kernel: Fix `Pipe::can_read_impl()` The logic was inversed, which made all select calls report incorrectly for pipes. This made terminal emulator just freeze. --- kernel/include/kernel/FS/Pipe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/include/kernel/FS/Pipe.h b/kernel/include/kernel/FS/Pipe.h index 972b22f3..b60545b9 100644 --- a/kernel/include/kernel/FS/Pipe.h +++ b/kernel/include/kernel/FS/Pipe.h @@ -34,7 +34,7 @@ namespace Kernel virtual BAN::ErrorOr read_impl(off_t, BAN::ByteSpan) override; virtual BAN::ErrorOr write_impl(off_t, BAN::ConstByteSpan) override; - virtual bool can_read_impl() const override { return m_buffer_size == 0; } + virtual bool can_read_impl() const override { return m_buffer_size > 0; } virtual bool can_write_impl() const override { return true; } virtual bool has_error_impl() const override { return false; }