Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2019-09-18 17:29:21 +0300
committerKen Brown <kbrown@cornell.edu>2019-09-20 23:18:47 +0300
commit81c55654e63e512f89e219ebf929a8fdb3e72a95 (patch)
tree4210150e2f916c335ca47b773ea24a368b6c88a7
parentb757a21d857608d800529149b1f05192a0d2d0f6 (diff)
Cygwin: pty: Add missing guard when PTY is in the legacy mode.
-rw-r--r--winsup/cygwin/fhandler_tty.cc5
1 files changed, 4 insertions, 1 deletions
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 ())