]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 7.4.1350 v7.4.1350
authorBram Moolenaar <Bram@vim.org>
Thu, 18 Feb 2016 21:17:42 +0000 (22:17 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 18 Feb 2016 21:17:42 +0000 (22:17 +0100)
Problem:    When the test server fails to start Vim hangs.
Solution:   Check that there is actually something to read from the tty fd.

src/os_unix.c
src/version.c

index 1f0f2c8046705032b86ac45c107ef6c97ee28609..cebef645c4798a6a1a8f6e3291b44d980d848c80 100644 (file)
@@ -5345,11 +5345,12 @@ WaitForChar(long msec)
 #if defined(__BEOS__)
     int
 #else
-    static  int
+    static int
 #endif
 RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED)
 {
     int                ret;
+    int                result;
 #if defined(FEAT_XCLIPBOARD) || defined(USE_XSMP) || defined(FEAT_MZSCHEME)
     static int busy = FALSE;
 
@@ -5466,6 +5467,9 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED)
 #endif
 
        ret = poll(fds, nfd, towait);
+
+       result = ret > 0 && (fds[0].revents & POLLIN);
+
 # ifdef FEAT_MZSCHEME
        if (ret == 0 && mzquantum_used)
            /* MzThreads scheduling is required and timeout occurred */
@@ -5613,6 +5617,10 @@ select_eintr:
 # endif
 
        ret = select(maxfd + 1, &rfds, NULL, &efds, tvp);
+       result = ret > 0 && FD_ISSET(fd, &rfds);
+       if (result)
+           --ret;
+
 # ifdef EINTR
        if (ret == -1 && errno == EINTR)
        {
@@ -5733,7 +5741,7 @@ select_eintr:
 #endif
     }
 
-    return (ret > 0);
+    return result;
 }
 
 #ifndef NO_EXPANDPATH
index 59f7f4bc8f008f08ccf8d069e826c19c1391dd32..8dcd9e3c7c042dbcf4f614640305fb40a5a65fec 100644 (file)
@@ -747,6 +747,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1350,
 /**/
     1349,
 /**/