This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 1/1] Cygwin: console: Fix the condition to interrupt select() by SIGWINCH
- From: Takashi Yano <takashi dot yano at nifty dot ne dot jp>
- To: cygwin-patches at cygwin dot com
- Cc: Takashi Yano <takashi dot yano at nifty dot ne dot jp>
- Date: Thu, 15 Aug 2019 14:03:00 +0900
- Subject: [PATCH 1/1] Cygwin: console: Fix the condition to interrupt select() by SIGWINCH
- Dkim-filter: OpenDKIM Filter v2.10.3 conuserg-05.nifty.com x7F539N3011273
- References: <20190815050300.6380-1-takashi.yano@nifty.ne.jp>
- Add code so that select() is not interrupted by SIGWINCH if it is
ignored (SIG_IGN or SIG_DFL).
---
winsup/cygwin/select.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 9cf892801..4e9256b9f 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -1045,7 +1045,9 @@ peek_console (select_record *me, bool)
else if (!PeekConsoleInputW (h, &irec, 1, &events_read) || !events_read)
break;
fh->acquire_input_mutex (INFINITE);
- if (fhandler_console::input_winch == fh->process_input_message ())
+ if (fhandler_console::input_winch == fh->process_input_message ()
+ && global_sigs[SIGWINCH].sa_handler != SIG_IGN
+ && global_sigs[SIGWINCH].sa_handler != SIG_DFL)
{
set_sig_errno (EINTR);
fh->release_input_mutex ();
--
2.21.0