summaryrefslogtreecommitdiffstats
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-03 17:03:29 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-03 17:03:29 +0200
commita38b2b737e244eb2e4f199e070b05f86f4d433d4 (patch)
tree3c4526319424926d16bc78b7440208280458ee77 /src/channel.c
parent647a530b33d9d767f591159c24c62de48e57dad7 (diff)
patch 8.2.0689: when using getaddrinfo() the error message is unclearv8.2.0689
Problem: When using getaddrinfo() the error message is unclear. Solution: Use gai_strerror() to get the message. (Ozaki Kiichi, closes #6034)
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/channel.c b/src/channel.c
index 9577f3dc46..68ac4bc299 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -955,6 +955,7 @@ channel_open(
int sd = -1;
channel_T *channel = NULL;
#ifdef FEAT_IPV6
+ int err;
struct addrinfo hints;
struct addrinfo *res = NULL;
struct addrinfo *addr = NULL;
@@ -986,10 +987,11 @@ channel_open(
// Set port number manually in order to prevent name resolution services
// from being invoked in the environment where AI_NUMERICSERV is not
// defined.
- if (getaddrinfo(hostname, NULL, &hints, &res) != 0)
+ if ((err = getaddrinfo(hostname, NULL, &hints, &res)) != 0)
{
ch_error(channel, "in getaddrinfo() in channel_open()");
- PERROR(_("E901: getaddrinfo() in channel_open()"));
+ semsg(_("E901: getaddrinfo() in channel_open(): %s"),
+ gai_strerror(err));
channel_free(channel);
return NULL;
}