]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: pty: Skip term_has_pcon_cap() if pseudo console is disabled.
authorTakashi Yano via Cygwin-patches <cygwin-patches@cygwin.com>
Mon, 14 Dec 2020 08:25:33 +0000 (17:25 +0900)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 14 Dec 2020 10:02:23 +0000 (11:02 +0100)
- This patch skips unnecessary term_has_pcon_cap() call if pseudo
  console is disabled.

winsup/cygwin/fhandler_tty.cc
winsup/cygwin/spawn.cc

index a6dc8e93b4f9d5351af214705e5d6626e428d1bf..845e511840e5a2f542811cde9533db0cffe2e1bd 100644 (file)
@@ -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. */
index 83b216f527dcdba9d37723622ab3620b7a03721b..5057af932973c2a39bb203cdbf38ffd37f0eb652 100644 (file)
@@ -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))
            {
This page took 0.032515 seconds and 5 git commands to generate.