diff --git a/test/syscalls/linux/pty.cc b/test/syscalls/linux/pty.cc index 28abbea99..f2dc04440 100644 --- a/test/syscalls/linux/pty.cc +++ b/test/syscalls/linux/pty.cc @@ -374,6 +374,8 @@ PosixErrorOr 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) {