summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-25 20:47:56 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-25 20:50:22 +0100
commit5af4e622b94a194e3feaea1b3b09229d7a93578b (patch)
tree1d814ef3b92989e464e4409dfabfed9324c00773 /Kernel/FileSystem.h
parent901b7d5d91b3eacda12dad01211b84a28e1a39a6 (diff)
downloadserenity-5af4e622b94a194e3feaea1b3b09229d7a93578b.zip
Kernel: Add KResult and KResultOr<T> classes.
The idea here is to combine a potential syscall error code with an arbitrary type in the case of success. I feel like this will end up much less error prone than returning some arbitrary type that kinda sorta has bool semantics (but sometimes not really) and passing the error through an out-param. This patch only converts a few syscalls to using it. More to come.
Diffstat (limited to 'Kernel/FileSystem.h')
-rw-r--r--Kernel/FileSystem.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/FileSystem.h b/Kernel/FileSystem.h
index 77169cd751..b3081e3269 100644
--- a/Kernel/FileSystem.h
+++ b/Kernel/FileSystem.h
@@ -15,6 +15,7 @@
#include <AK/kstdio.h>
#include <AK/Lock.h>
#include <AK/WeakPtr.h>
+#include <Kernel/KResult.h>
static const dword mepoch = 476763780;
@@ -96,7 +97,7 @@ public:
virtual bool remove_child(const String& name, int& error) = 0;
virtual RetainPtr<Inode> parent() const = 0;
virtual size_t directory_entry_count() const = 0;
- virtual bool chmod(mode_t, int& error) = 0;
+ virtual KResult chmod(mode_t) = 0;
LocalSocket* socket() { return m_socket.ptr(); }
const LocalSocket* socket() const { return m_socket.ptr(); }