Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3505420 authored by Mike Yu's avatar Mike Yu
Browse files

Remove the resolv_integration_test check whether fd is closed or not

The check is not thread-safe. It sometimes results in the tests flaky
because the fd gets reused in another thread as soon as it is closed.

Bug: 156755788
Test: Run resolv_integration_test
Change-Id: I5730fc993eb47cd3e54add3f8102eb68d812507c
parent 0c7b1ca2
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -2105,12 +2105,7 @@ int getAsyncResponse(int fd, int* rcode, uint8_t* buf, int bufLen) {
    ret = poll(wait_fd, 1, -1);
    revents = wait_fd[0].revents;
    if (revents & POLLIN) {
        int n = resNetworkResult(fd, rcode, buf, bufLen);
        // Verify that resNetworkResult() closed the fd
        char unused;
        EXPECT_EQ(-1, read(fd, &unused, sizeof unused));
        EXPECT_EQ(EBADF, errno);
        return n;
        return resNetworkResult(fd, rcode, buf, bufLen);
    }
    return -1;
}