From 1aa52ced5d6f090b6ee034626189ee03c1b2f582 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sun, 1 Apr 2018 19:39:53 +0200 Subject: support_format_addrinfo: Include unknown error number in result --- support/support_format_addrinfo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'support') 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; -- cgit v1.2.3