1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

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
21 changed files with 100 additions and 122 deletions

View file

@ -86,9 +86,7 @@ KResultOr<FlatPtr> Process::sys$unveil(Userspace<const Syscall::SC_unveil_params
new_unveiled_path = TRY(custody_or_error.value()->try_serialize_absolute_path());
} else if (custody_or_error.error() == ENOENT && parent_custody && (new_permissions & UnveilAccess::CreateOrRemove)) {
auto parent_custody_path = TRY(parent_custody->try_serialize_absolute_path());
new_unveiled_path = KLexicalPath::try_join(parent_custody_path->view(), KLexicalPath::basename(path->view()));
if (!new_unveiled_path)
return ENOMEM;
new_unveiled_path = TRY(KLexicalPath::try_join(parent_custody_path->view(), KLexicalPath::basename(path->view())));
} else {
// FIXME Should this be EINVAL?
return custody_or_error.error();