X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fclient.c;h=c558536c28aa6885c8a0bf720ab75c2d1eb202ae;hb=05b7f957ba42e79f49b3a62aea2502168c9abf7a;hp=ae6968f70c4922da746d6e46367bfe2be361a6b2;hpb=7b98850d3b8b2453b473fdfb6db52f4aa3fe39b6;p=mmh diff --git a/sbr/client.c b/sbr/client.c index ae6968f..c558536 100644 --- a/sbr/client.c +++ b/sbr/client.c @@ -2,8 +2,6 @@ /* * client.c -- connect to a server * - * $Id$ - * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. @@ -60,7 +58,9 @@ client (char *args, char *service, char *response, int len_response, int debug) } memset(&hints, 0, sizeof(hints)); +#ifdef AI_ADDRCONFIG hints.ai_flags = AI_ADDRCONFIG; +#endif hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; @@ -85,7 +85,7 @@ client (char *args, char *service, char *response, int len_response, int debug) char address[NI_MAXHOST]; rc = getnameinfo(ai->ai_addr, ai->ai_addrlen, address, - sizeof(address), NULL, NULL, NI_NUMERICHOST); + sizeof(address), NULL, 0, NI_NUMERICHOST); fprintf(stderr, "Connecting to %s...\n", rc ? "unknown" : address); @@ -111,9 +111,10 @@ client (char *args, char *service, char *response, int len_response, int debug) close(sd); } + + freeaddrinfo(res); } - freeaddrinfo(res); client_freelist(ap); strncpy (response, "no servers available", len_response); return NOTOK;