Net: Simplify how LocalSocket tracks open fds

Now that there can't be multiple clones of the same fd,
we only need to track whether or not an fd exists on each
side. Also there's no point in tracking connecting fds.
This commit is contained in:
Sergey Bugaev 2019-08-11 16:28:18 +03:00 committed by Andreas Kling
commit d46c3b0b5b
Notes: sideshowbarker 2024-07-19 12:45:07 +09:00
3 changed files with 22 additions and 22 deletions

View file

@ -33,6 +33,8 @@ FileDescription::FileDescription(File& file, SocketRole role)
if (file.is_inode())
m_inode = static_cast<InodeFile&>(file).inode();
set_socket_role(role);
if (is_socket())
socket()->attach(*this);
}
FileDescription::~FileDescription()
@ -51,10 +53,7 @@ void FileDescription::set_socket_role(SocketRole role)
return;
ASSERT(is_socket());
if (m_socket_role != SocketRole::None)
socket()->detach(*this);
m_socket_role = role;
socket()->attach(*this);
}
KResult FileDescription::fstat(stat& buffer)