From: David Schweikert Date: Fri, 3 Feb 2017 13:39:52 +0000 (+0100) Subject: fix DNS lookup error messages X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15ba41c72587536ebb28313f0320c413aa329375;p=fping.git fix DNS lookup error messages --- diff --git a/src/fping.c b/src/fping.c index 842e8f4..9de0509 100644 --- a/src/fping.c +++ b/src/fping.c @@ -2026,9 +2026,7 @@ void add_name(char* name) sizeof(namebuf) / sizeof(char), NULL, 0, 0); if (ret) { if (!quiet_flag) { - ret = getnameinfo(res->ai_addr, res->ai_addrlen, namebuf, - sizeof(namebuf) / sizeof(char), NULL, 0, 0); - print_warning("%s: can't reverse-lookup (%s)\n", name, gai_strerror(ret_ga)); + print_warning("%s: can't reverse-lookup (%s)\n", name, gai_strerror(ret)); } printname = name; } else { @@ -2043,7 +2041,7 @@ void add_name(char* name) sizeof(addrbuf) / sizeof(char), NULL, 0, NI_NUMERICHOST); if (ret) { if (!quiet_flag) { - print_warning("%s: can't forward-lookup address (%s)\n", name, gai_strerror(ret_ga)); + print_warning("%s: can't forward-lookup address (%s)\n", name, gai_strerror(ret)); } continue; }