diff --git a/contrib/win32/win32compat/console.c b/contrib/win32/win32compat/console.c index f34a8d19d40..12673ad3198 100644 --- a/contrib/win32/win32compat/console.c +++ b/contrib/win32/win32compat/console.c @@ -225,17 +225,6 @@ ConEnterRawMode() ScrollBottom = ConVisibleWindowHeight(); in_raw_mode = 1; - - /* - Consume and ignore the first WINDOW_BUFFER_SIZE_EVENT, as we've triggered it ourselves by updating the console settings above. - Not consuming this event can cause a race condition: the event can cause a write to the console to be printed twice as the - SIGWINCH interrupt makes the write operation think its failed, and causes it to try again. - */ - INPUT_RECORD peek_input; - int out_count = 0; - if (PeekConsoleInputW(GetConsoleInputHandle(), &peek_input, 1, &out_count) && peek_input.EventType == WINDOW_BUFFER_SIZE_EVENT) { - ReadConsoleInputW(GetConsoleInputHandle(), &peek_input, 1, &out_count); - } } /* Used to Uninitialize the Console */ diff --git a/contrib/win32/win32compat/signal.c b/contrib/win32/win32compat/signal.c index f61cdd882d8..24560eceed9 100644 --- a/contrib/win32/win32compat/signal.c +++ b/contrib/win32/win32compat/signal.c @@ -228,9 +228,9 @@ sw_process_pending_signals() if (sigismember(&pending_tmp, exp[i])) { if (sig_handlers[exp[i]] != W32_SIG_IGN) { w32_raise(exp[i]); - /* dont error EINTR for SIG_ALRM, */ - /* sftp client is not expecting it */ - if (exp[i] != W32_SIGALRM) + /* don't set errno=EINTR on SIGALRM, sftp client is not expecting it */ + /* don't set errno=EINTR on SIGWINCH in order to avoid breaking the sequence of waiting for completion of IO operations. */ + if (exp[i] != W32_SIGALRM && exp[i] != W32_SIGWINCH) sig_int = TRUE; } else if (exp[i] == W32_SIGCHLD) /*if SIGCHLD is SIG_IGN, reap zombies*/ sw_cleanup_child_zombies();