Kernel: Don't use ref_count() in MasterPTY::close()

With the recent fixes to how close() gets called this is not
necessary anymore.
This commit is contained in:
Gunnar Beutner 2021-05-01 22:53:58 +02:00 committed by Linus Groh
parent 9b2dd0f3b4
commit 0a94b4233f
Notes: sideshowbarker 2024-07-18 18:47:52 +09:00

View file

@ -94,14 +94,13 @@ bool MasterPTY::can_write_from_slave() const
KResult MasterPTY::close()
{
if (ref_count() == 2) {
InterruptDisabler disabler;
// After the closing FileDescription dies, slave is the only thing keeping me alive.
// From this point, let's consider ourselves closed.
m_closed = true;
InterruptDisabler disabler;
// After the closing FileDescription dies, slave is the only thing keeping me alive.
// From this point, let's consider ourselves closed.
m_closed = true;
if (m_slave)
m_slave->hang_up();
}
return KSuccess;
}