mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
Kernel+LibC: Turn errno codes into a strongly typed enum
..and allow implicit creation of KResult and KResultOr from ErrnoCode. This means that kernel functions that return those types can finally do "return EINVAL;" and it will just work. There's a handful of functions that still deal with signed integers that should be converted to return KResults.
This commit is contained in:
@@ -77,14 +77,14 @@ KResultOr<size_t> InodeWatcher::read(FileDescription&, size_t, UserOrKernelBuffe
|
||||
return (ssize_t)data_bytes;
|
||||
});
|
||||
if (nwritten < 0)
|
||||
return KResult(nwritten);
|
||||
return KResult((ErrnoCode)-nwritten);
|
||||
evaluate_block_conditions();
|
||||
return bytes_to_write;
|
||||
}
|
||||
|
||||
KResultOr<size_t> InodeWatcher::write(FileDescription&, size_t, const UserOrKernelBuffer&, size_t)
|
||||
{
|
||||
return KResult(-EIO);
|
||||
return EIO;
|
||||
}
|
||||
|
||||
String InodeWatcher::absolute_path(const FileDescription&) const
|
||||
|
||||
Reference in New Issue
Block a user