[Msan] Fix the accept unit test to pass on FreeBSD

Differential Revision: http://reviews.llvm.org/D7083

llvm-svn: 226650
This commit is contained in:
Viktor Kutuzov 2015-01-21 09:46:21 +00:00
parent f6894e9c2c
commit d518cb76ad
1 changed files with 5 additions and 2 deletions

View File

@ -868,8 +868,11 @@ TEST(MemorySanitizer, accept) {
res = fcntl(connect_socket, F_SETFL, O_NONBLOCK);
ASSERT_EQ(0, res);
res = connect(connect_socket, (struct sockaddr *)&sai, sizeof(sai));
ASSERT_EQ(-1, res);
ASSERT_EQ(EINPROGRESS, errno);
// On FreeBSD this connection completes immediately.
if (res != 0) {
ASSERT_EQ(-1, res);
ASSERT_EQ(EINPROGRESS, errno);
}
__msan_poison(&sai, sizeof(sai));
int new_sock = accept(listen_socket, (struct sockaddr *)&sai, &sz);