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/Devices/MemoryDevice.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/Devices/MemoryDevice.h')
-rw-r--r-- | Kernel/Devices/MemoryDevice.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Devices/MemoryDevice.h b/Kernel/Devices/MemoryDevice.h index 363a09bd82..90c3d928d7 100644 --- a/Kernel/Devices/MemoryDevice.h +++ b/Kernel/Devices/MemoryDevice.h @@ -21,7 +21,7 @@ public: static NonnullRefPtr<MemoryDevice> must_create(); ~MemoryDevice(); - virtual KResultOr<Memory::Region*> mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64 offset, int prot, bool shared) override; + virtual ErrorOr<Memory::Region*> mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64 offset, int prot, bool shared) override; private: MemoryDevice(); @@ -30,8 +30,8 @@ private: virtual bool can_read(const OpenFileDescription&, size_t) const override { return true; } virtual bool can_write(const OpenFileDescription&, size_t) const override { return false; } virtual bool is_seekable() const override { return true; } - virtual KResultOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override; - virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override { return EINVAL; } + virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override; + virtual ErrorOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override { return EINVAL; } virtual void did_seek(OpenFileDescription&, off_t) override; |