mirror of
https://sourceware.org/git/glibc.git
synced 2025-05-30 04:04:54 +03:00
support_format_hostent: Add more error information for NETDB_INTERNAL
This commit is contained in:
parent
ee417882e0
commit
84d0e6f052
@ -1,3 +1,8 @@
|
|||||||
|
2017-10-05 Florian Weimer <fweimer@redhat.com>
|
||||||
|
|
||||||
|
* support/support_format_hostent.c (support_format_hostent): Add
|
||||||
|
more error information for NETDB_INTERNAL.
|
||||||
|
|
||||||
2017-10-04 H.J. Lu <hongjiu.lu@intel.com>
|
2017-10-04 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* config.h.in (NO_HIDDEN_EXTERN_FUNC_IN_PIE): New.
|
* config.h.in (NO_HIDDEN_EXTERN_FUNC_IN_PIE): New.
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include <support/format_nss.h>
|
#include <support/format_nss.h>
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <support/support.h>
|
#include <support/support.h>
|
||||||
#include <support/xmemstream.h>
|
#include <support/xmemstream.h>
|
||||||
@ -40,12 +41,17 @@ char *
|
|||||||
support_format_hostent (struct hostent *h)
|
support_format_hostent (struct hostent *h)
|
||||||
{
|
{
|
||||||
if (h == NULL)
|
if (h == NULL)
|
||||||
|
{
|
||||||
|
if (h_errno == NETDB_INTERNAL)
|
||||||
|
return xasprintf ("error: NETDB_INTERNAL (errno %d, %m)\n", errno);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
char *value = support_format_herrno (h_errno);
|
char *value = support_format_herrno (h_errno);
|
||||||
char *result = xasprintf ("error: %s\n", value);
|
char *result = xasprintf ("error: %s\n", value);
|
||||||
free (value);
|
free (value);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct xmemstream mem;
|
struct xmemstream mem;
|
||||||
xopen_memstream (&mem);
|
xopen_memstream (&mem);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user