mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:18: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
|
@ -69,3 +69,12 @@ bool MasterPTY::can_write_from_slave() const
|
|||
{
|
||||
return m_buffer.bytes_in_write_buffer() < 4096;
|
||||
}
|
||||
|
||||
void MasterPTY::close()
|
||||
{
|
||||
if (retain_count() == 2) {
|
||||
// After the closing FileDescriptor dies, slave is the only thing keeping me alive.
|
||||
// From this point, let's consider ourselves closed.
|
||||
m_closed = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue