mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
Kernel: Properly implement SO_ERROR option
This fixes the placeholder stub for the SO_ERROR via getsockopt. It leverages the m_so_error value that each socket maintains. The SO_ERROR option obtains and then clears this field, which is useful when checking for errors that occur between socket calls. This uses an integer value to return the SO_ERROR status. Resolves #146
This commit is contained in:
parent
0095c7cb7d
commit
342e1f0a84
Notes:
sideshowbarker
2024-07-18 07:09:26 +09:00
Author: https://github.com/brapru
Commit: 342e1f0a84
Pull-request: https://github.com/SerenityOS/serenity/pull/9216
Issue: https://github.com/SerenityOS/serenity/issues/146
Reviewed-by: https://github.com/bgianfo ✅
2 changed files with 3 additions and 5 deletions
|
@ -343,9 +343,8 @@ KResultOr<size_t> LocalSocket::recvfrom(FileDescription& description, UserOrKern
|
|||
}
|
||||
} else if (!can_read(description, 0)) {
|
||||
auto unblock_flags = Thread::FileDescriptionBlocker::BlockFlags::None;
|
||||
if (Thread::current()->block<Thread::ReadBlocker>({}, description, unblock_flags).was_interrupted()) {
|
||||
if (Thread::current()->block<Thread::ReadBlocker>({}, description, unblock_flags).was_interrupted())
|
||||
return set_so_error(EINTR);
|
||||
}
|
||||
}
|
||||
if (!has_attached_peer(description) && socket_buffer->is_empty())
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue