mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
Kernel: Reading from a slave PTY should give EOF if master PTY is closed.
This commit is contained in:
parent
3accdb0e93
commit
378e20c535
5 changed files with 35 additions and 7 deletions
|
@ -43,6 +43,20 @@ bool SlavePTY::can_write(Process&) const
|
|||
return m_master->can_write_from_slave();
|
||||
}
|
||||
|
||||
bool SlavePTY::can_read(Process& process) const
|
||||
{
|
||||
if (m_master->is_closed())
|
||||
return true;
|
||||
return TTY::can_read(process);
|
||||
}
|
||||
|
||||
ssize_t SlavePTY::read(Process& process, byte* buffer, size_t size)
|
||||
{
|
||||
if (m_master->is_closed())
|
||||
return 0;
|
||||
return TTY::read(process, buffer, size);
|
||||
}
|
||||
|
||||
void SlavePTY::close()
|
||||
{
|
||||
m_master->notify_slave_closed(Badge<SlavePTY>());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue