test,freebsd: fix flaky poll tests

On FreeBSD `close()` can fail with `ECONNRESET` if the socket was
shutdown by the peer before all pending data was delivered.

PR-URL: https://github.com/libuv/libuv/pull/1780
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Santiago Gimeno 2018-03-20 21:21:26 +01:00 committed by cjihrig
parent 7f85924e8b
commit 9051126b56
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -134,7 +134,10 @@ static void close_socket(uv_os_sock_t sock) {
#else
r = close(sock);
#endif
ASSERT(r == 0);
/* On FreeBSD close() can fail with ECONNRESET if the socket was shutdown by
* the peer before all pending data was delivered.
*/
ASSERT(r == 0 || errno == ECONNRESET);
}