aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/vi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 602fc61d9..f59d5a706 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2211,11 +2211,20 @@ static void catch_sig(int sig)
2211 2211
2212static int mysleep(int hund) // sleep for 'hund' 1/100 seconds or stdin ready 2212static int mysleep(int hund) // sleep for 'hund' 1/100 seconds or stdin ready
2213{ 2213{
2214#if ENABLE_PLATFORM_MINGW32
2215 HANDLE h = GetStdHandle(STD_INPUT_HANDLE);
2216 DWORD ret;
2217
2218 fflush(stdout);
2219 ret = WaitForSingleObject(h, hund*10);
2220 return ret != WAIT_TIMEOUT;
2221#else
2214 struct pollfd pfd[1]; 2222 struct pollfd pfd[1];
2215 2223
2216 pfd[0].fd = STDIN_FILENO; 2224 pfd[0].fd = STDIN_FILENO;
2217 pfd[0].events = POLLIN; 2225 pfd[0].events = POLLIN;
2218 return safe_poll(pfd, 1, hund*10) > 0; 2226 return safe_poll(pfd, 1, hund*10) > 0;
2227#endif
2219} 2228}
2220 2229
2221//----- IO Routines -------------------------------------------- 2230//----- IO Routines --------------------------------------------