1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:47:35 +00:00

Kernel: Use KResultOr<size_t> throughout the TTY subsystem

Previously the VirtualConsole::on_tty_write() method would return an
incorrect value when an error had occurred. This prompted me to
update the TTY subsystem to use KResultOr<size_t> everywhere.
This commit is contained in:
Gunnar Beutner 2021-06-16 15:20:35 +02:00 committed by Andreas Kling
parent a49a15cabf
commit 1c3346e3ce
9 changed files with 29 additions and 29 deletions

View file

@ -17,7 +17,7 @@ class SlavePTY final : public TTY {
public:
virtual ~SlavePTY() override;
void on_master_write(const UserOrKernelBuffer&, ssize_t);
void on_master_write(const UserOrKernelBuffer&, size_t);
unsigned index() const { return m_index; }
time_t time_of_last_write() const { return m_time_of_last_write; }
@ -27,7 +27,7 @@ public:
private:
// ^TTY
virtual String const& tty_name() const override;
virtual ssize_t on_tty_write(const UserOrKernelBuffer&, ssize_t) override;
virtual KResultOr<size_t> on_tty_write(const UserOrKernelBuffer&, size_t) override;
virtual void echo(u8) override;
// ^CharacterDevice