]> granicus.if.org Git - pgbouncer/commitdiff
dnslookup: more informative error from getaddrinfo_a()
authorMarko Kreen <markokr@gmail.com>
Mon, 8 Oct 2012 08:11:31 +0000 (11:11 +0300)
committerMarko Kreen <markokr@gmail.com>
Mon, 8 Oct 2012 08:11:31 +0000 (11:11 +0300)
src/dnslookup.c

index c525bf8b14e7ec62f0c19c3e25a900d66069f96a..43db4e00fb58dfe255ff4bb5bd658b13b3a698df 100644 (file)
@@ -286,7 +286,11 @@ static void impl_launch_query(struct DNSRequest *req)
        return;
 
 failed:
-       log_warning("dns: getaddrinfo_a(%s)=%d", req->name, res);
+       if (res == EAI_SYSTEM)
+               log_warning("dns: getaddrinfo_a(%s)=%d, errno=%d (%s)",
+                           req->name, res, errno, strerror(errno));
+       else
+               log_warning("dns: getaddrinfo_a(%s)=%d", req->name, res);
        list_del(&grq->node);
        free(grq);
 failed2: