mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:48:11 +00:00
Net: Merge Thread::wait_for_connect into LocalSocket (as the only place that uses it)
Also do this more like other blockers, don't call yield ourselves, as block will do that for us.
This commit is contained in:
parent
833d444cd8
commit
96de90ceef
3 changed files with 9 additions and 17 deletions
|
@ -103,7 +103,15 @@ KResult LocalSocket::connect(FileDescription& description, const sockaddr* addre
|
|||
if (result.is_error())
|
||||
return result;
|
||||
|
||||
return current->wait_for_connect(description);
|
||||
if (is_connected())
|
||||
return KSuccess;
|
||||
|
||||
if (current->block<Thread::ConnectBlocker>(description) == Thread::BlockResult::InterruptedBySignal)
|
||||
return KResult(-EINTR);
|
||||
|
||||
if (!is_connected())
|
||||
return KResult(-ECONNREFUSED);
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
void LocalSocket::attach(FileDescription& description)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue