[pty] Return enqueued data and then EIO if the replica is closed

PiperOrigin-RevId: 532496868
This commit is contained in:
gVisor bot
2023-05-16 10:15:01 -07:00
parent 595d424651
commit 243aeddd59
4 changed files with 47 additions and 1 deletions
+3
View File
@@ -110,6 +110,9 @@ func (q *queue) read(ctx context.Context, dst usermem.IOSequence, l *lineDiscipl
defer q.mu.Unlock()
if !q.readable {
if l.numReplicas == 0 {
return 0, false, false, linuxerr.EIO
}
return 0, false, false, linuxerr.ErrWouldBlock
}