diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/clients/yp.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/clients/yp.c b/tests/clients/yp.c index 0557977..ceb092a 100644 --- a/tests/clients/yp.c +++ b/tests/clients/yp.c @@ -331,9 +331,16 @@ main(int argc, char **argv) six = 0; while ((c = getopt(argc, argv, "6ch:p:t:")) != -1) { switch (c) { +#ifdef HAVE_CLNTTCP6_CREATE case '6': six = 1; break; +#else + case '6': + fprintf(stderr, "IPv6 not supported\n"); + return 1; + break; +#endif case 'c': connected = 1; break; @@ -377,15 +384,17 @@ main(int argc, char **argv) memset(&timeout, 0, sizeof(timeout)); tv.tv_sec = timeout; sock = RPC_ANYSOCK; - client = six ? - (connected ? clnttcp6_create(&server, YPPROG, YPVERS, &sock, - 0, 0) : - clntudp6_create(&server, YPPROG, YPVERS, tv, - &sock)) : - (connected ? clnttcp_create(&server, YPPROG, YPVERS, &sock, - 0, 0) : - clntudp_create(&server, YPPROG, YPVERS, tv, - &sock)); + client = +#ifdef HAVE_CLNTTCP6_CREATE + six ? (connected ? clnttcp6_create(&server, YPPROG, YPVERS, &sock, + 0, 0) : + clntudp6_create(&server, YPPROG, YPVERS, tv, + &sock)) : +#endif + (connected ? clnttcp_create(&server, YPPROG, YPVERS, &sock, + 0, 0) : + clntudp_create(&server, YPPROG, YPVERS, tv, + &sock)); if (client == NULL) { fprintf(stderr, "error setting up RPC client\n"); return -1; |