From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107585 invoked by alias); 20 Sep 2019 21:59:24 -0000 Mailing-List: contact cygwin-cvs-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-cvs-owner@cygwin.com Received: (qmail 107566 invoked by uid 9996); 20 Sep 2019 21:59:23 -0000 Date: Fri, 20 Sep 2019 21:59:00 -0000 Message-ID: <20190920215923.107565.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Ken Brown To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pty: Add missing guard when PTY is in the legacy mode. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: b757a21d857608d800529149b1f05192a0d2d0f6 X-Git-Newrev: 81c55654e63e512f89e219ebf929a8fdb3e72a95 X-SW-Source: 2019-q3/txt/msg00084.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=81c55654e63e512f89e219ebf929a8fdb3e72a95 commit 81c55654e63e512f89e219ebf929a8fdb3e72a95 Author: Takashi Yano 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 ())