diff options
author | Andreas Kling <kling@serenityos.org> | 2020-12-18 14:10:10 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-18 19:22:26 +0100 |
commit | 8e79bde2b73d18f31e4dcc1b33c61cd5ec73c83d (patch) | |
tree | cfb7eeb32bc6305a6e14aa645e01de5dd3a11e23 /Kernel/Syscalls | |
parent | d936d86332241221151cc765404f1b383ac0fd0e (diff) | |
download | serenity-8e79bde2b73d18f31e4dcc1b33c61cd5ec73c83d.zip |
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.
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r-- | Kernel/Syscalls/module.cpp | 2 | ||||
-rw-r--r-- | Kernel/Syscalls/readlink.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscalls/module.cpp b/Kernel/Syscalls/module.cpp index f8d9e0ac9f..bc402e226d 100644 --- a/Kernel/Syscalls/module.cpp +++ b/Kernel/Syscalls/module.cpp @@ -53,7 +53,7 @@ int Process::sys$module_load(Userspace<const char*> user_path, size_t path_lengt if (payload_or_error.is_error()) return payload_or_error.error(); - auto payload = payload_or_error.value(); + auto& payload = *payload_or_error.value(); auto storage = KBuffer::create_with_size(payload.size()); memcpy(storage.data(), payload.data(), payload.size()); diff --git a/Kernel/Syscalls/readlink.cpp b/Kernel/Syscalls/readlink.cpp index b9da03db87..7c4b92a391 100644 --- a/Kernel/Syscalls/readlink.cpp +++ b/Kernel/Syscalls/readlink.cpp @@ -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; |