summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/Plan9FileSystem.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-08-14 14:02:47 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-14 15:19:00 +0200
commitd30d776ca46b12d7f4f9b5b7bdbfb247813a94af (patch)
tree396e08592d2c733fa1414314a1a63f031bd8686e /Kernel/FileSystem/Plan9FileSystem.cpp
parent46b93174fce7ec46f45529f83672ccdac9dd6079 (diff)
downloadserenity-d30d776ca46b12d7f4f9b5b7bdbfb247813a94af.zip
Kernel: Make FileSystem::initialize() return KResult
This forced me to also come up with error codes for a bunch of situations where we'd previously just panic the kernel.
Diffstat (limited to 'Kernel/FileSystem/Plan9FileSystem.cpp')
-rw-r--r--Kernel/FileSystem/Plan9FileSystem.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Kernel/FileSystem/Plan9FileSystem.cpp b/Kernel/FileSystem/Plan9FileSystem.cpp
index 657ba67a5e..163e69d6bd 100644
--- a/Kernel/FileSystem/Plan9FileSystem.cpp
+++ b/Kernel/FileSystem/Plan9FileSystem.cpp
@@ -195,7 +195,7 @@ private:
bool m_have_been_built { false };
};
-bool Plan9FS::initialize()
+KResult Plan9FS::initialize()
{
ensure_thread();
@@ -204,7 +204,7 @@ bool Plan9FS::initialize()
auto result = post_message_and_wait_for_a_reply(version_message);
if (result.is_error())
- return false;
+ return result;
u32 msize;
StringView remote_protocol_version;
@@ -227,11 +227,13 @@ bool Plan9FS::initialize()
result = post_message_and_wait_for_a_reply(attach_message);
if (result.is_error()) {
dbgln("Attaching failed");
- return false;
+ return result;
}
m_root_inode = Plan9FSInode::create(*this, root_fid);
- return true;
+ if (!m_root_inode)
+ return ENOMEM;
+ return KSuccess;
}
Plan9FS::ProtocolVersion Plan9FS::parse_protocol_version(const StringView& s) const