1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:57:35 +00:00

LibCore: Add Stream::File::fd()

Unlike `leak_fd()` the stream is still owning the file descriptor after
the call.
This commit is contained in:
Lucas CHOLLET 2023-01-15 19:34:01 -05:00 committed by Sam Atkins
parent c6aeb9811c
commit 2e52de5744

View file

@ -322,6 +322,11 @@ public:
return m_fd; return m_fd;
} }
int fd() const
{
return m_fd;
}
virtual ~File() override virtual ~File() override
{ {
if (m_should_close_file_descriptor == ShouldCloseFileDescriptor::Yes) if (m_should_close_file_descriptor == ShouldCloseFileDescriptor::Yes)