Skip to content

Commit ec70bdd

Browse files
committed
patch 7.4.1350
Problem: When the test server fails to start Vim hangs. Solution: Check that there is actually something to read from the tty fd.
1 parent 74a97b1 commit ec70bdd

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/os_unix.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5345,11 +5345,12 @@ WaitForChar(long msec)
53455345
#if defined(__BEOS__)
53465346
int
53475347
#else
5348-
static int
5348+
static int
53495349
#endif
53505350
RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED)
53515351
{
53525352
int ret;
5353+
int result;
53535354
#if defined(FEAT_XCLIPBOARD) || defined(USE_XSMP) || defined(FEAT_MZSCHEME)
53545355
static int busy = FALSE;
53555356

@@ -5466,6 +5467,9 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED)
54665467
#endif
54675468

54685469
ret = poll(fds, nfd, towait);
5470+
5471+
result = ret > 0 && (fds[0].revents & POLLIN);
5472+
54695473
# ifdef FEAT_MZSCHEME
54705474
if (ret == 0 && mzquantum_used)
54715475
/* MzThreads scheduling is required and timeout occurred */
@@ -5613,6 +5617,10 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED)
56135617
# endif
56145618

56155619
ret = select(maxfd + 1, &rfds, NULL, &efds, tvp);
5620+
result = ret > 0 && FD_ISSET(fd, &rfds);
5621+
if (result)
5622+
--ret;
5623+
56165624
# ifdef EINTR
56175625
if (ret == -1 && errno == EINTR)
56185626
{
@@ -5733,7 +5741,7 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED)
57335741
#endif
57345742
}
57355743

5736-
return (ret > 0);
5744+
return result;
57375745
}
57385746

57395747
#ifndef NO_EXPANDPATH

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,8 @@ static char *(features[]) =
747747

748748
static int included_patches[] =
749749
{ /* Add new patch number below this line */
750+
/**/
751+
1350,
750752
/**/
751753
1349,
752754
/**/

0 commit comments

Comments
 (0)