aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2018-04-01 19:39:53 +0200
committerFlorian Weimer <fweimer@redhat.com>2018-04-01 19:41:01 +0200
commit1aa52ced5d6f090b6ee034626189ee03c1b2f582 (patch)
tree34acfc43cc92f746bc157a3b72bf806e8677533e
parent4d76d3e59d31aa690f148fc0c95cc0c581aed3e8 (diff)
downloadglibc-1aa52ced5d6f090b6ee034626189ee03c1b2f582.zip
glibc-1aa52ced5d6f090b6ee034626189ee03c1b2f582.tar.gz
glibc-1aa52ced5d6f090b6ee034626189ee03c1b2f582.tar.bz2
support_format_addrinfo: Include unknown error number in result
-rw-r--r--ChangeLog5
-rw-r--r--support/support_format_addrinfo.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1f98425..fff9430 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-04-01 Florian Weimer <fweimer@redhat.com>
+
+ * support/support_format_addrinfo.c (support_format_addrinfo):
+ Include unknown error number in formatted result.
+
2018-03-29 Florian Weimer <fweimer@redhat.com>
* sysdeps/unix/sysv/linux/i386/tst-bz21269.c (do_test): Also
diff --git a/support/support_format_addrinfo.c b/support/support_format_addrinfo.c
index c5e00e5..f9dc97c 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;