mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
support_format_hostent: Add more error information for NETDB_INTERNAL
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <support/format_nss.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <support/support.h>
|
||||
#include <support/xmemstream.h>
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user