summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-02-28 22:33:46 +0100
committerBram Moolenaar <Bram@vim.org>2016-02-28 22:33:46 +0100
commite081e21f760bffc24ca98d5f9bbdb5f02e6aea79 (patch)
tree7c934aa9eabc01274ff94b6d735e092c4a552290
parentfdd6ce4a2f922afac7bd719a00228dbd8539b9c4 (diff)
downloadvim-git-7.4.1459.tar.gz
patch 7.4.1459v7.4.1459
Problem: MS-Windows doesn't know socklen_t. Solution: Use previous method for WIN32.
-rw-r--r--src/channel.c14
-rw-r--r--src/version.c2
2 files changed, 12 insertions, 4 deletions
diff --git a/src/channel.c b/src/channel.c
index 745d226a2..a1ea6b843 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -681,8 +681,10 @@ channel_open(
struct timeval tv;
fd_set rfds;
fd_set wfds;
+#ifndef WIN32
int so_error = 0;
socklen_t so_error_len = sizeof(so_error);
+#endif
FD_ZERO(&rfds);
FD_SET(sd, &rfds);
@@ -709,9 +711,12 @@ channel_open(
return NULL;
}
+#ifdef WIN32
/* On Win32: select() is expected to work and wait for up to the
- * waittime for the socket to be open.
- * On Linux-like systems: See socket(7) for the behavior
+ * waittime for the socket to be open. */
+ if (!FD_ISSET(sd, &wfds) || ret == 0)
+#else
+ /* On Linux-like systems: See socket(7) for the behavior
* After putting the socket in non-blocking mode, connect() will
* return EINPROGRESS, select() will not wait (as if writing is
* possible), need to use getsockopt() to check if the socket is
@@ -725,9 +730,9 @@ channel_open(
if (ret < 0 || (so_error != 0
&& so_error != EWOULDBLOCK
&& so_error != ECONNREFUSED
-#ifdef EINPROGRESS
+# ifdef EINPROGRESS
&& so_error != EINPROGRESS
-#endif
+# endif
))
{
ch_errorn(channel,
@@ -741,6 +746,7 @@ channel_open(
}
if (!FD_ISSET(sd, &wfds) || so_error != 0)
+#endif
{
#ifndef WIN32
struct timeval end_tv;
diff --git a/src/version.c b/src/version.c
index 0fb7b8a56..f9f412801 100644
--- a/src/version.c
+++ b/src/version.c
@@ -744,6 +744,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1459,
+/**/
1458,
/**/
1457,