diff src/os_win32.c @ 7866:30a9f5fc3508 v7.4.1230

commit https://github.com/vim/vim/commit/ca568aeec60dd6cc13b4dcf5cec0e0a07113547f Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 1 21:32:58 2016 +0100 patch 7.4.1230 Problem: Win32: opening a channel may hang. Not checking for messages while waiting for characters. Solution: Add a zero timeout. Call parse_queued_messages(). (Yasuhiro Matsumoto)
author Christian Brabandt <cb@256bit.org>
date Mon, 01 Feb 2016 21:45:05 +0100
parents c079097365f3
children 3f2e0b62003d
line wrap: on
line diff
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -1461,10 +1461,12 @@ WaitForChar(long msec)
      */
     for (;;)
     {
+#ifdef MESSAGE_QUEUE
+	parse_queued_messages();
+#endif
 #ifdef FEAT_MZSCHEME
 	mzvim_check_threads();
 #endif
-
 #ifdef FEAT_CLIENTSERVER
 	serverProcessPendingMessages();
 #endif
@@ -1474,7 +1476,11 @@ WaitForChar(long msec)
 	maxfd = channel_select_setup(-1, &rfds);
 	if (maxfd >= 0)
 	{
-	    ret = select(maxfd + 1, &rfds, NULL, NULL, NULL);
+	    struct timeval  tv;
+
+	    tv.tv_sec = 0;
+	    tv.tv_usec = 0;
+	    ret = select(maxfd + 1, &rfds, NULL, NULL, &tv);
 	    if (ret > 0 && channel_select_check(ret, &rfds) > 0)
 		return TRUE;
 	}