summaryrefslogtreecommitdiff
path: root/Kernel/TTY
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-10-24 21:03:49 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-10-24 21:03:49 +0200
commit5c3647b8a30d1ba3d2bb2b43bbb7b867dbcf28d6 (patch)
treeadd4c5a13e3cfde134d2639f48d4211c9347aab4 /Kernel/TTY
parentbced810880d38b0ff1ebdebc9d47c1ef081e3fa1 (diff)
downloadserenity-5c3647b8a30d1ba3d2bb2b43bbb7b867dbcf28d6.zip
TTY: MasterPTY should fail to ioctl() if slave is gone
Just fail with EIO in that case.
Diffstat (limited to 'Kernel/TTY')
-rw-r--r--Kernel/TTY/MasterPTY.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/TTY/MasterPTY.cpp b/Kernel/TTY/MasterPTY.cpp
index cace566a99..efd29a7f27 100644
--- a/Kernel/TTY/MasterPTY.cpp
+++ b/Kernel/TTY/MasterPTY.cpp
@@ -98,6 +98,8 @@ void MasterPTY::close()
int MasterPTY::ioctl(FileDescription& description, unsigned request, unsigned arg)
{
+ if (!m_slave)
+ return -EIO;
if (request == TIOCSWINSZ || request == TIOCGPGRP)
return m_slave->ioctl(description, request, arg);
return -EINVAL;