diff --git a/kernel/src/net/UnixSocket.cpp b/kernel/src/net/UnixSocket.cpp index 71863b0f..751ea959 100644 --- a/kernel/src/net/UnixSocket.cpp +++ b/kernel/src/net/UnixSocket.cpp @@ -159,6 +159,9 @@ Result UnixSocket::connect(Registers* regs, int flags, struct sockaddr* ad break; } + // This means that the connection was established, but closed before this thread could run again. + if (m_state == Reset) return err(ECONNABORTED); + check(m_state == Connected); check(m_peer);