diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-10-24 21:03:49 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-10-24 21:03:49 +0200 |
commit | 5c3647b8a30d1ba3d2bb2b43bbb7b867dbcf28d6 (patch) | |
tree | add4c5a13e3cfde134d2639f48d4211c9347aab4 /Kernel/TTY | |
parent | bced810880d38b0ff1ebdebc9d47c1ef081e3fa1 (diff) | |
download | serenity-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.cpp | 2 |
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; |