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.
This commit is contained in:
Luca Boccassi 2016-04-12 00:29:19 +01:00
parent edda1657fa
commit a01baba38b

View File

@ -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);