1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:08:10 +00:00

Kernel+Tests: Don't panic when LocalSocket is already bound

This commit is contained in:
Thomas Queiroz 2024-02-01 18:41:44 -05:00 committed by Andreas Kling
parent b365356eba
commit 2de9ffa632
2 changed files with 32 additions and 1 deletions

View file

@ -162,7 +162,8 @@ ErrorOr<void> LocalSocket::bind(Credentials const& credentials, Userspace<sockad
ErrorOr<void> LocalSocket::connect(Credentials const& credentials, OpenFileDescription& description, Userspace<sockaddr const*> user_address, socklen_t address_size)
{
VERIFY(!m_bound);
if (m_bound)
return set_so_error(EISCONN);
if (address_size > sizeof(sockaddr_un))
return set_so_error(EINVAL);