From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 50AC03858004; Mon, 14 Dec 2020 10:02:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50AC03858004 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pty: Skip term_has_pcon_cap() if pseudo console is disabled. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano via Cygwin-patches X-Git-Refname: refs/heads/master X-Git-Oldrev: cf1ef2dc5b95342fa337141b3b1ec85aac73229f X-Git-Newrev: c2c33e4d673f630a4f85ef8339e3456384e94850 Message-Id: <20201214100245.50AC03858004@sourceware.org> Date: Mon, 14 Dec 2020 10:02:45 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2020 10:02:45 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c2c33e4d673f630a4f85ef8339e3456384e94850 commit c2c33e4d673f630a4f85ef8339e3456384e94850 Author: Takashi Yano via Cygwin-patches Date: Mon Dec 14 17:25:33 2020 +0900 Cygwin: pty: Skip term_has_pcon_cap() if pseudo console is disabled. - This patch skips unnecessary term_has_pcon_cap() call if pseudo console is disabled. Diff: --- winsup/cygwin/fhandler_tty.cc | 2 -- winsup/cygwin/spawn.cc | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index a6dc8e93b..845e51184 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -2459,8 +2459,6 @@ fhandler_pty_slave::setup_pseudoconsole (STARTUPINFOEXW *si, bool nopcon) if (get_ttyp ()->pcon_pid && get_ttyp ()->pcon_pid != myself->pid && !!pinfo (get_ttyp ()->pcon_pid)) return false; - if (disable_pcon) - return false; /* If the legacy console mode is enabled, pseudo console seems not to work as expected. To determine console mode, registry key ForceV2 in HKEY_CURRENT_USER\Console is checked. */ diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 83b216f52..5057af932 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -656,7 +656,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, if (!iscygwin () && ptys_primary && is_console_app (runpath)) { bool nopcon = mode != _P_OVERLAY && mode != _P_WAIT; - if (!ptys_primary->term_has_pcon_cap (envblock)) + if (disable_pcon || !ptys_primary->term_has_pcon_cap (envblock)) nopcon = true; if (ptys_primary->setup_pseudoconsole (&si_pcon, nopcon)) {