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
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a47321a228
commit
7ff5096083
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user