diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -284,6 +284,14 @@ ATF_REQUIRE(close(sv[0]) == 0); } +static void +close_sockets_ignore_errors(int sv[2]) +{ + if (sv[0] != sv[1]) + close(sv[1]); + close(sv[0]); +} + static void fd_set_blocking(int fd) { @@ -1643,7 +1651,7 @@ free(outbuf); free(plaintext); - close_sockets(sockets); + close_sockets_ignore_errors(sockets); } static void @@ -1729,7 +1737,7 @@ free(outbuf); free(plaintext); - close_sockets(sockets); + close_sockets_ignore_errors(sockets); } static void @@ -1771,7 +1779,7 @@ free(outbuf); free(plaintext); - close_sockets(sockets); + close_sockets_ignore_errors(sockets); } static void @@ -1813,7 +1821,7 @@ free(outbuf); free(plaintext); - close_sockets(sockets); + close_sockets_ignore_errors(sockets); } static void @@ -1856,7 +1864,7 @@ free(outbuf); free(plaintext); - close_sockets(sockets); + close_sockets_ignore_errors(sockets); } static void @@ -1905,7 +1913,7 @@ free(outbuf); - close_sockets(sockets); + close_sockets_ignore_errors(sockets); } #define TLS_10_TESTS(M) \