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

Kernel: Remove FIFO::{attach,detach}(Direction)

These functions would have caused a `-Woverloaded-virtual` warning with
GCC 13, as they shadow `File::{attach,detach}(OpenFileDescription&)`.

Both of these functions had a single call site. This commit inlines
`attach` into its only caller, `FIFO::open_direction`.

Instead of explicitly checking `is_fifo()` in `~OpenFileDescription`
before running the `detach(Direction)` overload, let's just override the
regular `detach(OpenFileDescription&)` for `FIFO` to perform this action
instead.
This commit is contained in:
Daniel Bertalan 2023-05-11 11:02:37 +02:00 committed by Andreas Kling
parent f666989c9e
commit 2123fdd678
3 changed files with 10 additions and 20 deletions

View file

@ -53,8 +53,6 @@ OpenFileDescription::OpenFileDescription(File& file)
OpenFileDescription::~OpenFileDescription()
{
m_file->detach(*this);
if (is_fifo())
static_cast<FIFO*>(m_file.ptr())->detach(fifo_direction());
// FIXME: Should this error path be observed somehow?
(void)m_file->close();
if (m_inode)