mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
Kernel: Move KBufferBuilder to the fallible KBuffer API
KBufferBuilder::build() now returns an OwnPtr<KBuffer> and can fail. Clients of the API have been updated to handle that situation.
This commit is contained in:
parent
d936d86332
commit
8e79bde2b7
18 changed files with 121 additions and 100 deletions
|
@ -55,7 +55,7 @@ int Process::sys$readlink(Userspace<const Syscall::SC_readlink_params*> user_par
|
|||
if (contents.is_error())
|
||||
return contents.error();
|
||||
|
||||
auto& link_target = contents.value();
|
||||
auto& link_target = *contents.value();
|
||||
auto size_to_copy = min(link_target.size(), params.buffer.size);
|
||||
if (!copy_to_user(params.buffer.data, link_target.data(), size_to_copy))
|
||||
return -EFAULT;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue