[pty_test] Test that poll() actually sets the POLLIN flag in PollAndReadFd

PiperOrigin-RevId: 534841961
This commit is contained in:
gVisor bot
2023-05-24 08:06:54 -07:00
parent 333bd93e1a
commit 3b57dd815f
+2
View File
@@ -374,6 +374,8 @@ PosixErrorOr<size_t> PollAndReadFd(int fd, void* buf, size_t count,
continue;
}
return PosixError(errno, "read failed");
} else if (n > 0 && (pfd.revents & POLLIN) == 0) {
return PosixError(EINVAL, "Poll said not readable but data was read");
}
completed += n;
if (completed >= count) {