public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH COMMITTED] support_format_addrinfo: Include unknown error number in result
@ 2018-04-01 18:03 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2018-04-01 18:03 UTC (permalink / raw)
  To: libc-alpha

2018-04-01  Florian Weimer  <fweimer@redhat.com>

	* support/support_format_addrinfo.c (support_format_addrinfo):
	Include unknown error number in formatted result.

diff --git a/support/support_format_addrinfo.c b/support/support_format_addrinfo.c
index c5e00e516a..f9dc97c24d 100644
--- a/support/support_format_addrinfo.c
+++ b/support/support_format_addrinfo.c
@@ -220,7 +220,11 @@ support_format_addrinfo (struct addrinfo *ai, int ret)
   xopen_memstream (&mem);
   if (ret != 0)
     {
-      fprintf (mem.out, "error: %s\n", gai_strerror (ret));
+      const char *errmsg = gai_strerror (ret);
+      if (strcmp (errmsg, "Unknown error") == 0)
+        fprintf (mem.out, "error: Unknown error %d\n", ret);
+      else
+        fprintf (mem.out, "error: %s\n", errmsg);
       if (ret == EAI_SYSTEM)
         {
           errno = errno_copy;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-01 18:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-01 18:03 [PATCH COMMITTED] support_format_addrinfo: Include unknown error number in result Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).