kernel: Handle aborted connections instead of crashing

This commit is contained in:
apio 2024-02-03 19:15:19 +01:00
parent 75d0d12b71
commit 6bdf3169d2
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -159,6 +159,9 @@ Result<void> UnixSocket::connect(Registers* regs, int flags, struct sockaddr* ad
break; 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_state == Connected);
check(m_peer); check(m_peer);