0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.0689: when using getaddrinfo() the error message is unclear

Problem:    When using getaddrinfo() the error message is unclear.
Solution:   Use gai_strerror() to get the message. (Ozaki Kiichi,
            closes #6034)
This commit is contained in:
Bram Moolenaar 2020-05-03 17:03:29 +02:00
parent 647a530b33
commit a38b2b737e
2 changed files with 6 additions and 2 deletions

View File

@ -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;
}

View File

@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
689,
/**/
688,
/**/