mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:47:35 +00:00
Kernel: Make File::write() and File::read() return KResultOr<size_t>
Instead of returning a ssize_t where negative values mean error, we now return KResultOr<size_t> and use the error state to report errors exclusively.
This commit is contained in:
parent
58feebeed2
commit
7a3ab6c517
58 changed files with 223 additions and 229 deletions
|
@ -48,7 +48,7 @@ DiskPartition::~DiskPartition()
|
|||
{
|
||||
}
|
||||
|
||||
ssize_t DiskPartition::read(FileDescription& fd, size_t offset, u8* outbuf, ssize_t len)
|
||||
KResultOr<size_t> DiskPartition::read(FileDescription& fd, size_t offset, u8* outbuf, size_t len)
|
||||
{
|
||||
unsigned adjust = m_block_offset * block_size();
|
||||
|
||||
|
@ -70,7 +70,7 @@ bool DiskPartition::can_read(const FileDescription& fd, size_t offset) const
|
|||
return m_device->can_read(fd, offset + adjust);
|
||||
}
|
||||
|
||||
ssize_t DiskPartition::write(FileDescription& fd, size_t offset, const u8* inbuf, ssize_t len)
|
||||
KResultOr<size_t> DiskPartition::write(FileDescription& fd, size_t offset, const u8* inbuf, size_t len)
|
||||
{
|
||||
unsigned adjust = m_block_offset * block_size();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue