summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-12-28 02:34:59 +0000
committerngie <ngie@FreeBSD.org>2015-12-28 02:34:59 +0000
commitd248315c93517c0df95a1ffdecca53bd90bb89c1 (patch)
tree64d6083fefe51613a46fa7f66a63834982a7803b /tests
parent44e964f2d22a0b35860e49cceb36bfcea2231cf7 (diff)
downloadFreeBSD-src-d248315c93517c0df95a1ffdecca53bd90bb89c1.zip
FreeBSD-src-d248315c93517c0df95a1ffdecca53bd90bb89c1.tar.gz
- Remove unused but set ssize in shutdown_send_sigpipe
- Add #ifdef TEST_SEQ_PACKET_SOURCE_ADDRESS` for untestable code because FreeBSD doesn't have a means to map source addresses for SEQ_PACKET AF_UNIX sockets (paraphrased). Put pathname variable under the #ifdef to mute another unused but set variable warning MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'tests')
-rw-r--r--tests/sys/kern/unix_seqpacket_test.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/sys/kern/unix_seqpacket_test.c b/tests/sys/kern/unix_seqpacket_test.c
index 3a62c56..7305ab3 100644
--- a/tests/sys/kern/unix_seqpacket_test.c
+++ b/tests/sys/kern/unix_seqpacket_test.c
@@ -671,7 +671,9 @@ ATF_TC_BODY(send_recv, tc)
ATF_TC_WITHOUT_HEAD(sendto_recvfrom);
ATF_TC_BODY(sendto_recvfrom, tc)
{
+#ifdef TEST_SEQ_PACKET_SOURCE_ADDRESS
const char* path;
+#endif
struct sockaddr_storage from;
int sv[2];
const int bufsize = 64;
@@ -682,7 +684,10 @@ ATF_TC_BODY(sendto_recvfrom, tc)
socklen_t fromlen;
/* setup the socket pair */
- path = mk_pair_of_sockets(sv);
+#ifdef TEST_SEQ_PACKET_SOURCE_ADDRESS
+ path =
+#endif
+ mk_pair_of_sockets(sv);
/* send and receive a small packet */
datalen = strlen(data) + 1; /* +1 for the null */
@@ -703,14 +708,16 @@ ATF_TC_BODY(sendto_recvfrom, tc)
}
ATF_CHECK_EQ(datalen, rsize);
+#ifdef TEST_SEQ_PACKET_SOURCE_ADDRESS
/*
* FreeBSD does not currently provide the source address for SEQ_PACKET
* AF_UNIX sockets, and POSIX does not require it, so these two checks
* are disabled. If FreeBSD gains that feature in the future, then
* these checks may be reenabled
*/
- /* ATF_CHECK_EQ(PF_LOCAL, from.ss_family); */
- /* ATF_CHECK_STREQ(path, ((struct sockaddr_un*)&from)->sun_path); */
+ ATF_CHECK_EQ(PF_LOCAL, from.ss_family);
+ ATF_CHECK_STREQ(path, ((struct sockaddr_un*)&from)->sun_path);
+#endif
close(sv[0]);
close(sv[1]);
}
@@ -795,7 +802,6 @@ ATF_TC_BODY(shutdown_send_sigpipe, tc)
/* ATF's isolation mechanisms will guarantee uniqueness of this file */
const char *path = "sock";
const char *data = "data";
- ssize_t ssize;
int s, err, s2;
s = socket(PF_LOCAL, SOCK_SEQPACKET, 0);
@@ -820,7 +826,7 @@ ATF_TC_BODY(shutdown_send_sigpipe, tc)
ATF_CHECK_EQ(0, shutdown(s2, SHUT_RDWR));
ATF_REQUIRE(SIG_ERR != signal(SIGPIPE, shutdown_send_sigpipe_handler));
- ssize = send(s2, data, sizeof(data), MSG_EOR);
+ (void)send(s2, data, sizeof(data), MSG_EOR);
ATF_CHECK_EQ(1, got_sigpipe);
close(s);
close(s2);
OpenPOWER on IntegriCloud