mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +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:
parent
d30d776ca4
commit
7676edfb9b
14 changed files with 51 additions and 52 deletions
|
@ -19,10 +19,10 @@ KResultOr<FlatPtr> Process::sys$fstat(int fd, Userspace<stat*> user_statbuf)
|
|||
if (!description)
|
||||
return EBADF;
|
||||
stat buffer = {};
|
||||
int rc = description->stat(buffer);
|
||||
auto result = description->stat(buffer);
|
||||
if (!copy_to_user(user_statbuf, &buffer))
|
||||
return EFAULT;
|
||||
return rc;
|
||||
return result;
|
||||
}
|
||||
|
||||
KResultOr<FlatPtr> Process::sys$stat(Userspace<const Syscall::SC_stat_params*> user_params)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue