Skip to content

Commit

Permalink
Kernel: Don't use ref_count() in MasterPTY::close()
Browse files Browse the repository at this point in the history
With the recent fixes to how close() gets called this is not
necessary anymore.
  • Loading branch information
gunnarbeutner authored and linusg committed May 1, 2021
1 parent 9b2dd0f commit 0a94b42
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Kernel/TTY/MasterPTY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0a94b42

Please sign in to comment.