diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-08 00:51:39 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-08 01:10:53 +0100 |
commit | 79fa9765ca89869d19364143989436d117974c21 (patch) | |
tree | 3af62f70127d9217d841047f6b7461351800d1ae /Kernel/TTY/MasterPTY.h | |
parent | 7ee10c69264cb278845a1e1b06d5acf2e5e7ddf0 (diff) | |
download | serenity-79fa9765ca89869d19364143989436d117974c21.zip |
Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T>
We now use AK::Error and AK::ErrorOr<T> in both kernel and userspace!
This was a slightly tedious refactoring that took a long time, so it's
not unlikely that some bugs crept in.
Nevertheless, it does pass basic functionality testing, and it's just
real nice to finally see the same pattern in all contexts. :^)
Diffstat (limited to 'Kernel/TTY/MasterPTY.h')
-rw-r--r-- | Kernel/TTY/MasterPTY.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Kernel/TTY/MasterPTY.h b/Kernel/TTY/MasterPTY.h index cf5f1da616..6ebe95dd4c 100644 --- a/Kernel/TTY/MasterPTY.h +++ b/Kernel/TTY/MasterPTY.h @@ -16,28 +16,28 @@ class SlavePTY; class MasterPTY final : public CharacterDevice { public: - static KResultOr<NonnullRefPtr<MasterPTY>> try_create(unsigned index); + static ErrorOr<NonnullRefPtr<MasterPTY>> try_create(unsigned index); virtual ~MasterPTY() override; unsigned index() const { return m_index; } KString const& pts_name() const; - KResultOr<size_t> on_slave_write(const UserOrKernelBuffer&, size_t); + ErrorOr<size_t> on_slave_write(const UserOrKernelBuffer&, size_t); bool can_write_from_slave() const; void notify_slave_closed(Badge<SlavePTY>); bool is_closed() const { return m_closed; } - virtual KResultOr<NonnullOwnPtr<KString>> pseudo_path(const OpenFileDescription&) const override; + virtual ErrorOr<NonnullOwnPtr<KString>> pseudo_path(const OpenFileDescription&) const override; private: explicit MasterPTY(unsigned index, NonnullOwnPtr<DoubleBuffer> buffer, NonnullOwnPtr<KString> pts_name); // ^CharacterDevice - virtual KResultOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override; - virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override; + virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override; + virtual ErrorOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override; virtual bool can_read(const OpenFileDescription&, size_t) const override; virtual bool can_write(const OpenFileDescription&, size_t) const override; - virtual KResult close() override; + virtual ErrorOr<void> close() override; virtual bool is_master_pty() const override { return true; } - virtual KResult ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override; + virtual ErrorOr<void> ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override; virtual StringView class_name() const override { return "MasterPTY"sv; } RefPtr<SlavePTY> m_slave; |