Page MenuHomeFreeBSD

D35425.diff
No OneTemporary

D35425.diff

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
@@ -88,7 +88,7 @@
}
static bool
-socketpair_tcp(int *sv)
+socketpair_tcp(int sv[2])
{
struct pollfd pfd;
struct sockaddr_in sin;
@@ -161,6 +161,13 @@
return (true);
}
+static void
+close_sockets(int sv[2])
+{
+ ATF_REQUIRE(close(sv[1]) == 0);
+ ATF_REQUIRE(close(sv[0]) == 0);
+}
+
static void
fd_set_blocking(int fd)
{
@@ -993,8 +1000,7 @@
free(decrypted);
free(plaintext);
- ATF_REQUIRE(close(sockets[1]) == 0);
- ATF_REQUIRE(close(sockets[0]) == 0);
+ close_sockets(sockets);
ATF_REQUIRE(close(kq) == 0);
}
@@ -1079,8 +1085,7 @@
free(decrypted);
free(plaintext);
- ATF_REQUIRE(close(sockets[1]) == 0);
- ATF_REQUIRE(close(sockets[0]) == 0);
+ close_sockets(sockets);
}
static void
@@ -1142,8 +1147,7 @@
out:
free(outbuf);
- ATF_REQUIRE(close(sockets[1]) == 0);
- ATF_REQUIRE(close(sockets[0]) == 0);
+ close_sockets(sockets);
}
static size_t
@@ -1282,8 +1286,7 @@
free(received);
free(plaintext);
- ATF_REQUIRE(close(sockets[1]) == 0);
- ATF_REQUIRE(close(sockets[0]) == 0);
+ close_sockets(sockets);
ATF_REQUIRE(close(kq) == 0);
}
@@ -1532,8 +1535,7 @@
sizeof(*en)) == -1);
ATF_REQUIRE(errno == EINVAL);
- ATF_REQUIRE(close(sockets[1]) == 0);
- ATF_REQUIRE(close(sockets[0]) == 0);
+ close_sockets(sockets);
}
#define GEN_INVALID_TRANSMIT_TEST(name, cipher_alg, key_size, auth_alg, \
@@ -1665,8 +1667,7 @@
sizeof(*en)) == -1);
ATF_REQUIRE(errno == EINVAL);
- ATF_REQUIRE(close(sockets[1]) == 0);
- ATF_REQUIRE(close(sockets[0]) == 0);
+ close_sockets(sockets);
}
#define GEN_INVALID_RECEIVE_TEST(name, cipher_alg, key_size, auth_alg, \
@@ -1705,8 +1706,7 @@
sizeof(*en)) == -1);
ATF_REQUIRE(errno == EPROTONOSUPPORT);
- ATF_REQUIRE(close(sockets[1]) == 0);
- ATF_REQUIRE(close(sockets[0]) == 0);
+ close_sockets(sockets);
}
#define GEN_UNSUPPORTED_RECEIVE_TEST(name, cipher_alg, key_size, \

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 15, 2:09 PM (16 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14643448
Default Alt Text
D35425.diff (1 KB)

Event Timeline