summaryrefslogtreecommitdiff
path: root/Kernel/MasterPTY.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-05 12:55:19 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-05 12:55:19 +0100
commit2a0700af9ac4917c0f653350717f033621db9235 (patch)
tree67483edc6c60a9df9f2adf68055a3a4558650d92 /Kernel/MasterPTY.cpp
parent378e20c535a3f8b7f6f5519a1a3fe6b1c4949a12 (diff)
downloadserenity-2a0700af9ac4917c0f653350717f033621db9235.zip
Kernel: Closing a MasterPTY should generate a TTY hangup.
Diffstat (limited to 'Kernel/MasterPTY.cpp')
-rw-r--r--Kernel/MasterPTY.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Kernel/MasterPTY.cpp b/Kernel/MasterPTY.cpp
index 40511ac501..44cd81de65 100644
--- a/Kernel/MasterPTY.cpp
+++ b/Kernel/MasterPTY.cpp
@@ -3,6 +3,7 @@
#include "PTYMultiplexer.h"
#include <Kernel/Process.h>
#include <LibC/errno_numbers.h>
+#include <LibC/signal_numbers.h>
MasterPTY::MasterPTY(unsigned index)
: CharacterDevice(10, index)
@@ -73,8 +74,11 @@ bool MasterPTY::can_write_from_slave() const
void MasterPTY::close()
{
if (retain_count() == 2) {
+ InterruptDisabler disabler;
// After the closing FileDescriptor dies, slave is the only thing keeping me alive.
// From this point, let's consider ourselves closed.
m_closed = true;
+
+ m_slave->hang_up();
}
}