public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: pty: Skip term_has_pcon_cap() if pseudo console is disabled.
Date: Mon, 14 Dec 2020 10:02:45 +0000 (GMT)	[thread overview]
Message-ID: <20201214100245.50AC03858004@sourceware.org> (raw)

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

commit c2c33e4d673f630a4f85ef8339e3456384e94850
Author: Takashi Yano via Cygwin-patches <cygwin-patches@cygwin.com>
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))
 	    {


                 reply	other threads:[~2020-12-14 10:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201214100245.50AC03858004@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).