mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04: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
|
@ -29,7 +29,7 @@ bool File::unref() const
|
|||
return true;
|
||||
}
|
||||
|
||||
KResultOr<NonnullRefPtr<OpenFileDescription>> File::open(int options)
|
||||
ErrorOr<NonnullRefPtr<OpenFileDescription>> File::open(int options)
|
||||
{
|
||||
auto description = OpenFileDescription::try_create(*this);
|
||||
if (!description.is_error()) {
|
||||
|
@ -39,25 +39,25 @@ KResultOr<NonnullRefPtr<OpenFileDescription>> File::open(int options)
|
|||
return description;
|
||||
}
|
||||
|
||||
KResult File::close()
|
||||
ErrorOr<void> File::close()
|
||||
{
|
||||
return KSuccess;
|
||||
return {};
|
||||
}
|
||||
|
||||
KResult File::ioctl(OpenFileDescription&, unsigned, Userspace<void*>)
|
||||
ErrorOr<void> File::ioctl(OpenFileDescription&, unsigned, Userspace<void*>)
|
||||
{
|
||||
return ENOTTY;
|
||||
}
|
||||
|
||||
KResultOr<Memory::Region*> File::mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64, int, bool)
|
||||
ErrorOr<Memory::Region*> File::mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64, int, bool)
|
||||
{
|
||||
return ENODEV;
|
||||
}
|
||||
|
||||
KResult File::attach(OpenFileDescription&)
|
||||
ErrorOr<void> File::attach(OpenFileDescription&)
|
||||
{
|
||||
m_attach_count++;
|
||||
return KSuccess;
|
||||
return {};
|
||||
}
|
||||
|
||||
void File::detach(OpenFileDescription&)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue