diff options
author | Zach Koopmans <zkoopmans@google.com> | 2020-09-21 15:04:13 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-09-21 15:06:05 -0700 |
commit | 06dbd5b7bcd8ff16d73c38bdeac4677698385a65 (patch) | |
tree | 3cfde2ebfccb1314dfd12ae9f278dd3d8d248b29 /test/syscalls/linux/socket_test_util.cc | |
parent | 10dcefbc77815314d56e45f01b8c9986a2c56778 (diff) |
Fix socket_ipv4_udp_unbound_test_native in opensource.
Calls to recv sometimes fail with EAGAIN, so call select beforehand.
PiperOrigin-RevId: 332943156
Diffstat (limited to 'test/syscalls/linux/socket_test_util.cc')
-rw-r--r-- | test/syscalls/linux/socket_test_util.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/syscalls/linux/socket_test_util.cc b/test/syscalls/linux/socket_test_util.cc index 317db5e0f..e11792309 100644 --- a/test/syscalls/linux/socket_test_util.cc +++ b/test/syscalls/linux/socket_test_util.cc @@ -762,7 +762,8 @@ PosixErrorOr<int> RecvMsgTimeout(int sock, char buf[], int buf_size, int ret; RETURN_ERROR_IF_SYSCALL_FAIL(ret = select(1, &rfd, NULL, NULL, &to)); - RETURN_ERROR_IF_SYSCALL_FAIL(ret = recv(sock, buf, buf_size, MSG_DONTWAIT)); + RETURN_ERROR_IF_SYSCALL_FAIL( + ret = RetryEINTR(recv)(sock, buf, buf_size, MSG_DONTWAIT)); return ret; } |