mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
Kernel: Store socket errors as errno codes rather than ErrorOr values
This commit is contained in:
parent
d32961777b
commit
bd4bddf31b
Notes:
sideshowbarker
2024-07-17 20:19:08 +09:00
Author: https://github.com/trflynn89
Commit: bd4bddf31b
Pull-request: https://github.com/SerenityOS/serenity/pull/17399
Reviewed-by: https://github.com/linusg
2 changed files with 11 additions and 11 deletions
|
@ -169,11 +169,9 @@ ErrorOr<void> Socket::getsockopt(OpenFileDescription&, int level, int option, Us
|
|||
case SO_ERROR: {
|
||||
if (size < sizeof(int))
|
||||
return EINVAL;
|
||||
int errno;
|
||||
if (so_error().is_error())
|
||||
errno = so_error().error().code();
|
||||
else
|
||||
errno = 0;
|
||||
int errno = 0;
|
||||
if (auto const& error = so_error(); error.has_value())
|
||||
errno = error.value();
|
||||
TRY(copy_to_user(static_ptr_cast<int*>(value), &errno));
|
||||
size = sizeof(int);
|
||||
TRY(copy_to_user(value_size, &size));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue