From 84d0e6f05212cabe786cdf00bf3ba5d166d077c0 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 5 Oct 2017 12:20:19 +0200 Subject: support_format_hostent: Add more error information for NETDB_INTERNAL --- support/support_format_hostent.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'support') diff --git a/support/support_format_hostent.c b/support/support_format_hostent.c index 5b5f260..88c85ec 100644 --- a/support/support_format_hostent.c +++ b/support/support_format_hostent.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -41,10 +42,15 @@ support_format_hostent (struct hostent *h) { if (h == NULL) { - char *value = support_format_herrno (h_errno); - char *result = xasprintf ("error: %s\n", value); - free (value); - return result; + if (h_errno == NETDB_INTERNAL) + return xasprintf ("error: NETDB_INTERNAL (errno %d, %m)\n", errno); + else + { + char *value = support_format_herrno (h_errno); + char *result = xasprintf ("error: %s\n", value); + free (value); + return result; + } } struct xmemstream mem; -- cgit v1.1