From a01baba38b9ffed9358666afe96c936542b7d83e Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 12 Apr 2016 00:29:19 +0100 Subject: [PATCH] Problem: test_use_fd_tcp does not work on Solaris Solution: pass a struct addrinfo hint to getaddrinfo with a hint about the address family to avoid a failure. --- tests/test_use_fd_tcp.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/test_use_fd_tcp.cpp b/tests/test_use_fd_tcp.cpp index 8357c683..eb386543 100644 --- a/tests/test_use_fd_tcp.cpp +++ b/tests/test_use_fd_tcp.cpp @@ -35,8 +35,17 @@ void pre_allocate_sock (void *zmq_socket, const char *address, const char *port) { - struct addrinfo *addr; - int rc = getaddrinfo (address, port, NULL, &addr); + struct addrinfo *addr, hint; + hint.ai_flags=0; + hint.ai_family=AF_INET; + hint.ai_socktype=SOCK_STREAM; + hint.ai_protocol=IPPROTO_TCP; + hint.ai_addrlen=0; + hint.ai_canonname=NULL; + hint.ai_addr=NULL; + hint.ai_next=NULL; + + int rc = getaddrinfo (address, port, &hint, &addr); assert (rc == 0); int s_pre = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);