mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
net: convert standalone SetSocketNonBlocking() to Sock::SetNonBlocking()
This further encapsulates syscalls inside the `Sock` class. Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>
This commit is contained in:
@@ -254,6 +254,19 @@ int FuzzedSock::GetSockName(sockaddr* name, socklen_t* name_len) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool FuzzedSock::SetNonBlocking() const
|
||||
{
|
||||
constexpr std::array setnonblocking_errnos{
|
||||
EBADF,
|
||||
EPERM,
|
||||
};
|
||||
if (m_fuzzed_data_provider.ConsumeBool()) {
|
||||
SetFuzzedErrNo(m_fuzzed_data_provider, setnonblocking_errnos);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FuzzedSock::IsSelectable() const
|
||||
{
|
||||
return m_selectable;
|
||||
|
||||
Reference in New Issue
Block a user