Kernel: Make KString factories return KResultOr + use TRY() everywhere

There are a number of places that don't have an error propagation path
right now, so I've added FIXME's about that.
This commit is contained in:
Andreas Kling 2021-09-06 19:24:54 +02:00
parent 69b9b2888c
commit 56a2594de7
Notes: sideshowbarker 2024-07-18 04:35:00 +09:00
21 changed files with 100 additions and 122 deletions

View file

@ -323,9 +323,7 @@ KResultOr<NonnullRefPtr<FileDescription>> VirtualFileSystem::create(StringView p
{
auto basename = KLexicalPath::basename(path);
auto parent_path = TRY(parent_custody.try_serialize_absolute_path());
auto full_path = KLexicalPath::try_join(parent_path->view(), basename);
if (!full_path)
return ENOMEM;
auto full_path = TRY(KLexicalPath::try_join(parent_path->view(), basename));
TRY(validate_path_against_process_veil(full_path->view(), options));
if (!is_socket(mode) && !is_fifo(mode) && !is_block_device(mode) && !is_character_device(mode)) {