This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH v2 1/1] Cygwin: console: Make console input work in GDB and strace.
- 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: Sat, 21 Sep 2019 06:10:35 +0900
- Subject: [PATCH v2 1/1] Cygwin: console: Make console input work in GDB and strace.
- Dkim-filter: OpenDKIM Filter v2.10.3 conuserg-03.nifty.com x8KLAWxJ011747
- References: <20190920211035.952-1-takashi.yano@nifty.ne.jp>
- After commit 2232498c712acc97a38fdc297cbe53ba74d0ec2c, console
input cause error in GDB or strace. This patch fixes this issue.
---
winsup/cygwin/pinfo.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index ffd4c8cd9..35c1ffe25 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -570,7 +570,7 @@ _pinfo::set_ctty (fhandler_termios *fh, int flags)
tc.setsid (sid);
sid = tc.getsid ();
/* See above */
- if (!tc.getpgid () && pgid == pid)
+ if ((!tc.getpgid () || being_debugged ()) && pgid == pid)
tc.setpgid (pgid);
}
debug_printf ("cygheap->ctty now %p, archetype %p", cygheap->ctty, fh ? fh->archetype : NULL);
--
2.21.0