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:
Robin Burchell 2019-07-20 11:10:46 +02:00 committed by Andreas Kling
commit 96de90ceef
Notes: sideshowbarker 2024-07-19 13:07:44 +09:00
3 changed files with 9 additions and 17 deletions

View file

@ -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)