1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 03:37:35 +00:00

Kernel: Fix checking BlockResult

We now have BlockResult::WokeNormally and BlockResult::NotBlocked,
both of which indicate no error. We can no longer just check for
BlockResult::WokeNormally and assume anything else must be an
interruption.
This commit is contained in:
Tom 2020-07-06 17:10:52 -06:00 committed by Andreas Kling
parent 1493dd9dc6
commit 419703a1f2
7 changed files with 56 additions and 27 deletions

View file

@ -372,7 +372,7 @@ KResult TCPSocket::protocol_connect(FileDescription& description, ShouldBlock sh
m_direction = Direction::Outgoing;
if (should_block == ShouldBlock::Yes) {
if (Thread::current()->block<Thread::ConnectBlocker>(description) != Thread::BlockResult::WokeNormally)
if (Thread::current()->block<Thread::ConnectBlocker>(description).was_interrupted())
return KResult(-EINTR);
ASSERT(setup_state() == SetupState::Completed);
if (has_error()) {