1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

Kernel: Stop allowing implicit conversion from KResult to int

This patch removes KResult::operator int() and deals with the fallout.
This forces a lot of code to be more explicit in its handling of errors,
greatly improving readability.
This commit is contained in:
Andreas Kling 2021-08-14 15:15:11 +02:00
parent d30d776ca4
commit 7676edfb9b
14 changed files with 51 additions and 52 deletions

View file

@ -97,7 +97,7 @@ KResultOr<FlatPtr> Process::sys$unveil(Userspace<const Syscall::SC_unveil_params
new_unveiled_path = custody_or_error.value()->try_create_absolute_path();
if (!new_unveiled_path)
return ENOMEM;
} else if (custody_or_error.error() == -ENOENT && parent_custody && (new_permissions & UnveilAccess::CreateOrRemove)) {
} else if (custody_or_error.error() == ENOENT && parent_custody && (new_permissions & UnveilAccess::CreateOrRemove)) {
auto parent_custody_path = parent_custody->try_create_absolute_path();
if (!parent_custody_path)
return ENOMEM;