summaryrefslogtreecommitdiff
path: root/Kernel/TTY/MasterPTY.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/TTY/MasterPTY.cpp')
-rw-r--r--Kernel/TTY/MasterPTY.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/Kernel/TTY/MasterPTY.cpp b/Kernel/TTY/MasterPTY.cpp
index 42a80baf58..6a82964bea 100644
--- a/Kernel/TTY/MasterPTY.cpp
+++ b/Kernel/TTY/MasterPTY.cpp
@@ -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;
}