1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

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
parent 1606261c58
commit d46c3b0b5b
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)