Allow reading from PTY into bad buffer to return EAGAIN.
Kernels after 3b830a9c return EAGAIN in this case. PiperOrigin-RevId: 361936327
This commit is contained in:
parent
abbdcebc54
commit
6ef5bdab21
|
@ -1255,8 +1255,11 @@ TEST_F(PtyTest, PartialBadBuffer) {
|
|||
|
||||
// Read from the replica into bad_buffer.
|
||||
ASSERT_NO_ERRNO(WaitUntilReceived(replica_.get(), size));
|
||||
EXPECT_THAT(ReadFd(replica_.get(), bad_buffer, size),
|
||||
SyscallFailsWithErrno(EFAULT));
|
||||
// Before Linux 3b830a9c this returned EFAULT, but after that commit it
|
||||
// returns EAGAIN.
|
||||
EXPECT_THAT(
|
||||
ReadFd(replica_.get(), bad_buffer, size),
|
||||
AnyOf(SyscallFailsWithErrno(EFAULT), SyscallFailsWithErrno(EAGAIN)));
|
||||
|
||||
EXPECT_THAT(munmap(addr, 2 * kPageSize), SyscallSucceeds()) << addr;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue