aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-08-28 22:10:08 +0300
committerArnold D. Robbins <arnold@skeeve.com>2017-08-28 22:10:08 +0300
commit834c4e7da954326f385a2bce21e963e3063e145a (patch)
treef3d1202e100f168aa286581c7bff9861583c216f /io.c
parent3dc121c0569474fc156e2bdef809fb486a595fc9 (diff)
downloadegawk-834c4e7da954326f385a2bce21e963e3063e145a.tar.gz
egawk-834c4e7da954326f385a2bce21e963e3063e145a.tar.bz2
egawk-834c4e7da954326f385a2bce21e963e3063e145a.zip
Use gai_strerror for error messages if getaddrinfo fails.
Diffstat (limited to 'io.c')
-rw-r--r--io.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/io.c b/io.c
index 02278551..6330fcda 100644
--- a/io.c
+++ b/io.c
@@ -1586,7 +1586,12 @@ socketopen(int family, int type, const char *localpname,
lerror = getaddrinfo(NULL, localpname, & lhints, & lres);
if (lerror) {
if (strcmp(localpname, "0") != 0) {
+#ifdef HAVE_GAI_STRERROR
+ warning(_("local port %s invalid in `/inet': %s"), localpname,
+ gai_strerror(lerror));
+#else
warning(_("local port %s invalid in `/inet'"), localpname);
+#endif
*hard_error = true;
return INVALID_HANDLE;
}
@@ -1607,7 +1612,12 @@ socketopen(int family, int type, const char *localpname,
if (rerror) {
if (lres0 != NULL)
freeaddrinfo(lres0);
+#ifdef HAVE_GAI_STRERROR
+ warning(_("remote host and port information (%s, %s) invalid: %s"), remotehostname, remotepname,
+ gai_strerror(rerror));
+#else
warning(_("remote host and port information (%s, %s) invalid"), remotehostname, remotepname);
+#endif
*hard_error = true;
return INVALID_HANDLE;
}