Kernel: Don't panic if UNIX socket is already bound but deleted

This commit is contained in:
Bananymous 2025-06-27 13:45:21 +03:00
parent 7bf7bfbe13
commit 4695fa061d
1 changed files with 2 additions and 1 deletions

View File

@ -251,7 +251,8 @@ namespace Kernel
)); ));
SpinLockGuard _(s_bound_socket_lock); SpinLockGuard _(s_bound_socket_lock);
ASSERT(!s_bound_sockets.contains(file.canonical_path)); if (s_bound_sockets.contains(file.canonical_path))
return BAN::Error::from_errno(EADDRINUSE);
TRY(s_bound_sockets.emplace(file.canonical_path, TRY(get_weak_ptr()))); TRY(s_bound_sockets.emplace(file.canonical_path, TRY(get_weak_ptr())));
m_bound_path = BAN::move(file.canonical_path); m_bound_path = BAN::move(file.canonical_path);