public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: pty: Add missing guard when PTY is in the legacy mode.
@ 2019-09-20 21:59 Ken Brown
  0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2019-09-20 21:59 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=81c55654e63e512f89e219ebf929a8fdb3e72a95

commit 81c55654e63e512f89e219ebf929a8fdb3e72a95
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Wed Sep 18 23:29:21 2019 +0900

    Cygwin: pty: Add missing guard when PTY is in the legacy mode.

Diff:
---
 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 2a92e44..1095c82 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 ())


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-20 21:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 21:59 [newlib-cygwin] Cygwin: pty: Add missing guard when PTY is in the legacy mode Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).