diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-10 11:55:37 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-10 21:58:58 +0100 |
commit | 88b6428c25ea046a4bb19bb6f3f68dd4f1439539 (patch) | |
tree | 86eca67f4ffc83d5387590b0d502ecce7cc07b91 /Kernel/FileSystem/ISO9660FileSystem.cpp | |
parent | cd49f30bea734feb9ac46d637e2ed3439e47e3c3 (diff) | |
download | serenity-88b6428c25ea046a4bb19bb6f3f68dd4f1439539.zip |
AK: Make Vector::try_* functions return ErrorOr<void>
Instead of signalling allocation failure with a bool return value
(false), we now use ErrorOr<void> and return ENOMEM as appropriate.
This allows us to use TRY() and MUST() with Vector. :^)
Diffstat (limited to 'Kernel/FileSystem/ISO9660FileSystem.cpp')
-rw-r--r-- | Kernel/FileSystem/ISO9660FileSystem.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Kernel/FileSystem/ISO9660FileSystem.cpp b/Kernel/FileSystem/ISO9660FileSystem.cpp index b42398719f..fb53518945 100644 --- a/Kernel/FileSystem/ISO9660FileSystem.cpp +++ b/Kernel/FileSystem/ISO9660FileSystem.cpp @@ -55,10 +55,7 @@ public: if (has_flag(m_current_header->file_flags, ISO::FileFlags::Directory)) { dbgln_if(ISO9660_VERY_DEBUG, "next(): Recursing"); { - bool result = m_directory_stack.try_append(move(m_current_directory)); - if (!result) { - return ENOMEM; - } + TRY(m_directory_stack.try_append(move(m_current_directory))); } dbgln_if(ISO9660_VERY_DEBUG, "next(): Pushed into directory stack"); |