mirror of
https://github.com/RGBCube/serenity
synced 2025-07-19 18:57:40 +00:00
TTY: MasterPTY should fail to ioctl() if slave is gone
Just fail with EIO in that case.
This commit is contained in:
parent
bced810880
commit
5c3647b8a3
1 changed files with 2 additions and 0 deletions
|
@ -98,6 +98,8 @@ void MasterPTY::close()
|
||||||
|
|
||||||
int MasterPTY::ioctl(FileDescription& description, unsigned request, unsigned arg)
|
int MasterPTY::ioctl(FileDescription& description, unsigned request, unsigned arg)
|
||||||
{
|
{
|
||||||
|
if (!m_slave)
|
||||||
|
return -EIO;
|
||||||
if (request == TIOCSWINSZ || request == TIOCGPGRP)
|
if (request == TIOCSWINSZ || request == TIOCGPGRP)
|
||||||
return m_slave->ioctl(description, request, arg);
|
return m_slave->ioctl(description, request, arg);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue