kernel: Avoid page faults when reading from a slave pseudoterminal after the master is destroyed
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-09-23 12:57:03 +02:00
parent a47321a228
commit 7ff5096083
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -36,6 +36,8 @@ Result<usize> SlavePTY::write(const u8* buf, usize, usize length)
bool SlavePTY::will_block_if_read() const bool SlavePTY::will_block_if_read() const
{ {
if (!m_master) return false;
if (!m_master->is_canonical()) return m_buffer.is_empty(); if (!m_master->is_canonical()) return m_buffer.is_empty();
else else
return !m_master->m_lines.size(); return !m_master->m_lines.size();