diff options
author | Takashi Yano via Cygwin-patches <cygwin-patches@cygwin.com> | 2021-02-14 18:42:50 +0900 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2021-02-15 14:22:10 +0100 |
commit | ad2877505520025abfb9eef2696ac14aec1f8c2e (patch) | |
tree | cf3f709adac50a9c5bdc7eda151e3684fea27c7f /winsup/cygwin/fhandler_console.cc | |
parent | 2b94fad48edf07490113ab5052f2a39cfccb43c9 (diff) | |
download | newlib-ad2877505520025abfb9eef2696ac14aec1f8c2e.zip newlib-ad2877505520025abfb9eef2696ac14aec1f8c2e.tar.gz newlib-ad2877505520025abfb9eef2696ac14aec1f8c2e.tar.bz2 |
Cygwin: console: Abort read() on signal if SA_RESTART is not set.
- Currently, console read() keeps reading after SIGWINCH is sent
even if SA_RESTART flag is not set. With this patch, read()
returns EINTR on SIGWINCH if SA_RESTART flag is not set.
The same problem for SIGQUIT and SIGTSTP has also been fixed.
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 3c07835..78af6cf 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -586,12 +586,11 @@ wait_retry: case input_ok: /* input ready */ break; case input_signalled: /* signalled */ - release_input_mutex (); - /* The signal will be handled by cygwait() above. */ - continue; case input_winch: release_input_mutex (); - continue; + if (global_sigs[get_ttyp ()->last_sig].sa_flags & SA_RESTART) + continue; + goto sig_exit; default: /* Should not come here */ release_input_mutex (); |