summaryrefslogtreecommitdiff
path: root/Kernel/Console.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-04 18:02:23 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-04 18:17:16 +0200
commit7a3ab6c517649e9dfdd50085f10492212b0bcb18 (patch)
treef251cfc69ebe5f253c1e900c10b9485136b315cd /Kernel/Console.h
parent58feebeed28bab04e7b462f7cd3beb81984f116e (diff)
downloadserenity-7a3ab6c517649e9dfdd50085f10492212b0bcb18.zip
Kernel: Make File::write() and File::read() return KResultOr<size_t>
Instead of returning a ssize_t where negative values mean error, we now return KResultOr<size_t> and use the error state to report errors exclusively.
Diffstat (limited to 'Kernel/Console.h')
-rw-r--r--Kernel/Console.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Console.h b/Kernel/Console.h
index ff1ce9d356..e58733f49e 100644
--- a/Kernel/Console.h
+++ b/Kernel/Console.h
@@ -42,8 +42,8 @@ public:
// ^CharacterDevice
virtual bool can_read(const Kernel::FileDescription&, size_t) const override;
virtual bool can_write(const Kernel::FileDescription&, size_t) const override { return true; }
- virtual ssize_t read(Kernel::FileDescription&, size_t, u8*, ssize_t) override;
- virtual ssize_t write(Kernel::FileDescription&, size_t, const u8*, ssize_t) override;
+ virtual Kernel::KResultOr<size_t> read(Kernel::FileDescription&, size_t, u8*, size_t) override;
+ virtual Kernel::KResultOr<size_t> write(Kernel::FileDescription&, size_t, const u8*, size_t) override;
virtual const char* class_name() const override { return "Console"; }
void put_char(char);