diff options
author | Andreas Kling <kling@serenityos.org> | 2021-01-20 23:11:17 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-20 23:20:02 +0100 |
commit | 19d3f8cab77a95b284e30f142521c6b483221324 (patch) | |
tree | 8df3f585e91113215b52d10a9a0032c9998dc1b5 /Kernel/FileSystem/AnonymousFile.h | |
parent | e279b45aed5509efc537fc8c831f40733d7b1028 (diff) | |
download | serenity-19d3f8cab77a95b284e30f142521c6b483221324.zip |
Kernel+LibC: Turn errno codes into a strongly typed enum
..and allow implicit creation of KResult and KResultOr from ErrnoCode.
This means that kernel functions that return those types can finally
do "return EINVAL;" and it will just work.
There's a handful of functions that still deal with signed integers
that should be converted to return KResults.
Diffstat (limited to 'Kernel/FileSystem/AnonymousFile.h')
-rw-r--r-- | Kernel/FileSystem/AnonymousFile.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/FileSystem/AnonymousFile.h b/Kernel/FileSystem/AnonymousFile.h index 66b6c331e5..d95fc5fcb0 100644 --- a/Kernel/FileSystem/AnonymousFile.h +++ b/Kernel/FileSystem/AnonymousFile.h @@ -46,8 +46,8 @@ private: virtual String absolute_path(const FileDescription&) const override { return ":anonymous-file:"; } virtual bool can_read(const FileDescription&, size_t) const override { return false; } virtual bool can_write(const FileDescription&, size_t) const override { return false; } - virtual KResultOr<size_t> read(FileDescription&, size_t, UserOrKernelBuffer&, size_t) override { return KResult(-ENOTSUP); } - virtual KResultOr<size_t> write(FileDescription&, size_t, const UserOrKernelBuffer&, size_t) override { return KResult(-ENOTSUP); } + virtual KResultOr<size_t> read(FileDescription&, size_t, UserOrKernelBuffer&, size_t) override { return ENOTSUP; } + virtual KResultOr<size_t> write(FileDescription&, size_t, const UserOrKernelBuffer&, size_t) override { return ENOTSUP; } explicit AnonymousFile(NonnullRefPtr<AnonymousVMObject>); |