]> granicus.if.org Git - vim/commitdiff
patch 8.2.0689: when using getaddrinfo() the error message is unclear v8.2.0689
authorBram Moolenaar <Bram@vim.org>
Sun, 3 May 2020 15:03:29 +0000 (17:03 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 3 May 2020 15:03:29 +0000 (17:03 +0200)
Problem:    When using getaddrinfo() the error message is unclear.
Solution:   Use gai_strerror() to get the message. (Ozaki Kiichi,
            closes #6034)

src/channel.c
src/version.c

index 9577f3dc46ae3d92a2d6e318d48c16e2fabf37d9..68ac4bc29921794417d2190e27cf79c262727f3a 100644 (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;
     }
index fcc897a0f5104ac6a2703dc31a5176430f94616e..c083372006f6843cb139006721d76d06a5258b0c 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    689,
 /**/
     688,
 /**/