TTY: MasterPTY should fail to ioctl() if slave is gone

Just fail with EIO in that case.
This commit is contained in:
Andreas Kling 2019-10-24 21:03:49 +02:00
parent bced810880
commit 5c3647b8a3

View file

@ -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;