#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;
#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 */
# 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)
{
#endif
}
- return (ret > 0);
+ return result;
}
#ifndef NO_EXPANDPATH