diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-10 15:44:54 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-10 21:58:58 +0100 |
commit | 4661ca5f1553b87cb638a062629ee1510b93353b (patch) | |
tree | 9fce0909875f0eeecd1875ecf9135c3f0bb53cc2 /Kernel/FileSystem | |
parent | 5ce753b74d669aa240cae310ed41984158205f21 (diff) | |
download | serenity-4661ca5f1553b87cb638a062629ee1510b93353b.zip |
Kernel: Propagate Vector append errors in two places in Ext2FS
There are a bunch more of these, just taking care of some simple ones.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/Ext2FileSystem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/FileSystem/Ext2FileSystem.cpp b/Kernel/FileSystem/Ext2FileSystem.cpp index b6b1a49514..7f0b74405d 100644 --- a/Kernel/FileSystem/Ext2FileSystem.cpp +++ b/Kernel/FileSystem/Ext2FileSystem.cpp @@ -1169,7 +1169,7 @@ ErrorOr<void> Ext2FSInode::add_child(Inode& child, const StringView& name, mode_ TRY(traverse_as_directory([&](auto& entry) -> ErrorOr<void> { if (name == entry.name) return EEXIST; - entries.append({ entry.name, entry.inode.index(), entry.file_type }); + TRY(entries.try_append({ entry.name, entry.inode.index(), entry.file_type })); return {}; })); @@ -1203,7 +1203,7 @@ ErrorOr<void> Ext2FSInode::remove_child(const StringView& name) Vector<Ext2FSDirectoryEntry> entries; TRY(traverse_as_directory([&](auto& entry) -> ErrorOr<void> { if (name != entry.name) - entries.append({ entry.name, entry.inode.index(), entry.file_type }); + TRY(entries.try_append({ entry.name, entry.inode.index(), entry.file_type })); return {}; })); |