mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Deflake pty_test_linux.
PiperOrigin-RevId: 314208973
This commit is contained in:
committed by
gVisor bot
parent
12f74bd6f6
commit
6ef5924725
@@ -364,6 +364,12 @@ PosixErrorOr<size_t> PollAndReadFd(int fd, void* buf, size_t count,
|
||||
ssize_t n =
|
||||
ReadFd(fd, static_cast<char*>(buf) + completed, count - completed);
|
||||
if (n < 0) {
|
||||
if (errno == EAGAIN) {
|
||||
// Linux sometimes returns EAGAIN from this read, despite the fact that
|
||||
// poll returned success. Let's just do what do as we are told and try
|
||||
// again.
|
||||
continue;
|
||||
}
|
||||
return PosixError(errno, "read failed");
|
||||
}
|
||||
completed += n;
|
||||
|
||||
Reference in New Issue
Block a user