mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:37:34 +00:00
Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T>
We now use AK::Error and AK::ErrorOr<T> in both kernel and userspace! This was a slightly tedious refactoring that took a long time, so it's not unlikely that some bugs crept in. Nevertheless, it does pass basic functionality testing, and it's just real nice to finally see the same pattern in all contexts. :^)
This commit is contained in:
parent
7ee10c6926
commit
79fa9765ca
262 changed files with 2415 additions and 2600 deletions
|
@ -30,16 +30,16 @@ UNMAP_AFTER_INIT PowerStateSwitchNode::PowerStateSwitchNode(FirmwareSysFSDirecto
|
|||
{
|
||||
}
|
||||
|
||||
KResult PowerStateSwitchNode::truncate(u64 size)
|
||||
ErrorOr<void> PowerStateSwitchNode::truncate(u64 size)
|
||||
{
|
||||
// Note: This node doesn't store any useful data anyway, so we can safely
|
||||
// truncate this to zero (essentially ignoring the request without failing).
|
||||
if (size != 0)
|
||||
return EPERM;
|
||||
return KSuccess;
|
||||
return {};
|
||||
}
|
||||
|
||||
KResultOr<size_t> PowerStateSwitchNode::write_bytes(off_t offset, size_t count, UserOrKernelBuffer const& data, OpenFileDescription*)
|
||||
ErrorOr<size_t> PowerStateSwitchNode::write_bytes(off_t offset, size_t count, UserOrKernelBuffer const& data, OpenFileDescription*)
|
||||
{
|
||||
if (Checked<off_t>::addition_would_overflow(offset, count))
|
||||
return EOVERFLOW;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue