This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 5/5] Cygwin: pty: Add missing guard when PTY is in the legacy mode.
- 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: Wed, 18 Sep 2019 23:29:21 +0900
- Subject: [PATCH 5/5] Cygwin: pty: Add missing guard when PTY is in the legacy mode.
- Dkim-filter: OpenDKIM Filter v2.10.3 conuserg-06.nifty.com x8IETKE3031962
- References: <20190918142921.835-1-takashi.yano@nifty.ne.jp>
---
winsup/cygwin/fhandler_tty.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 2a92e44cf..1095c82eb 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -87,7 +87,8 @@ set_switch_to_pcon (void)
{
fhandler_base *fh = cfd;
fhandler_pty_slave *ptys = (fhandler_pty_slave *) fh;
- ptys->set_switch_to_pcon (fd);
+ if (ptys->getPseudoConsole ())
+ ptys->set_switch_to_pcon (fd);
}
}
@@ -105,6 +106,8 @@ force_attach_to_pcon (HANDLE h)
{
fhandler_base *fh = cfd;
fhandler_pty_slave *ptys = (fhandler_pty_slave *) fh;
+ if (!ptys->getPseudoConsole ())
+ continue;
if (n != 0
|| h == ptys->get_handle ()
|| h == ptys->get_output_handle ())
--
2.21.0