diff options
author | Andreas Kling <kling@serenityos.org> | 2021-08-14 14:02:47 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-14 15:19:00 +0200 |
commit | d30d776ca46b12d7f4f9b5b7bdbfb247813a94af (patch) | |
tree | 396e08592d2c733fa1414314a1a63f031bd8686e /Kernel/FileSystem/ISO9660FileSystem.cpp | |
parent | 46b93174fce7ec46f45529f83672ccdac9dd6079 (diff) | |
download | serenity-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/ISO9660FileSystem.cpp')
-rw-r--r-- | Kernel/FileSystem/ISO9660FileSystem.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Kernel/FileSystem/ISO9660FileSystem.cpp b/Kernel/FileSystem/ISO9660FileSystem.cpp index 3d2b852f0c..127efe9a47 100644 --- a/Kernel/FileSystem/ISO9660FileSystem.cpp +++ b/Kernel/FileSystem/ISO9660FileSystem.cpp @@ -202,18 +202,15 @@ ISO9660FS::~ISO9660FS() { } -bool ISO9660FS::initialize() -{ - if (!BlockBasedFileSystem::initialize()) - return false; - - // FIXME: Fix the FileSystem::initialize contract to be able to return a - // KResult. - if (parse_volume_set().is_error()) - return false; - if (create_root_inode().is_error()) - return false; - return true; +KResult ISO9660FS::initialize() +{ + if (auto result = BlockBasedFileSystem::initialize(); result.is_error()) + return result; + if (auto result = parse_volume_set(); result.is_error()) + return result; + if (auto result = create_root_inode(); result.is_error()) + return result; + return KSuccess; } Inode& ISO9660FS::root_inode() |