[PATCH] Cygwin: console: Make console input work in GDB and strace.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Cygwin: console: Make console input work in GDB and strace.

Takashi Yano
- After commit 2232498c712acc97a38fdc297cbe53ba74d0ec2c, console
  input cause error in GDB or strace. This patch fixes this issue.
---
 winsup/cygwin/fhandler_termios.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc
index 5b0ba5603..282f0fbf4 100644
--- a/winsup/cygwin/fhandler_termios.cc
+++ b/winsup/cygwin/fhandler_termios.cc
@@ -202,7 +202,8 @@ fhandler_termios::bg_check (int sig, bool dontsignal)
   */
   if (!myself->pgid || !tc () || tc ()->getpgid () == myself->pgid ||
  myself->ctty != tc ()->ntty ||
- ((sig == SIGTTOU) && !(tc ()->ti.c_lflag & TOSTOP)))
+ ((sig == SIGTTOU) && !(tc ()->ti.c_lflag & TOSTOP)) ||
+ being_debugged ())
     return bg_ok;
 
   /* sig -SIGTTOU is used to indicate a change to terminal settings, where
--
2.21.0