X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fzookeeper.c;fp=src%2Fzookeeper.c;h=a3b73628bdc44d76db44f73a91d475c97fbb552d;hb=aa3811995bfae69f0d1a0f897acfa4a9a4c0138a;hp=a236c8ae66404bd5173c0be7e2537246e34511f4;hpb=fe62d5e7df4374616d17246889d61a57ef46a1c4;p=collectd.git diff --git a/src/zookeeper.c b/src/zookeeper.c index a236c8ae..a3b73628 100644 --- a/src/zookeeper.c +++ b/src/zookeeper.c @@ -105,17 +105,19 @@ static int zookeeper_connect (void) { int sk = -1; int status; - struct addrinfo ai_hints = { 0 }; struct addrinfo *ai; struct addrinfo *ai_list; const char *host; const char *port; - ai_hints.ai_family = AF_UNSPEC; - ai_hints.ai_socktype = SOCK_STREAM; - host = (zk_host != NULL) ? zk_host : ZOOKEEPER_DEF_HOST; port = (zk_port != NULL) ? zk_port : ZOOKEEPER_DEF_PORT; + + struct addrinfo ai_hints = { + .ai_family = AF_UNSPEC, + .ai_socktype = SOCK_STREAM + }; + status = getaddrinfo (host, port, &ai_hints, &ai_list); if (status != 0) {