4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-18 23:12:15 +08:00

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.
This commit is contained in:
Takashi Yano via Cygwin-patches 2020-12-14 17:25:33 +09:00 committed by Corinna Vinschen
parent cf1ef2dc5b
commit c2c33e4d67
2 changed files with 1 additions and 3 deletions

View 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 if (get_ttyp ()->pcon_pid && get_ttyp ()->pcon_pid != myself->pid
&& !!pinfo (get_ttyp ()->pcon_pid)) && !!pinfo (get_ttyp ()->pcon_pid))
return false; return false;
if (disable_pcon)
return false;
/* If the legacy console mode is enabled, pseudo console seems /* If the legacy console mode is enabled, pseudo console seems
not to work as expected. To determine console mode, registry not to work as expected. To determine console mode, registry
key ForceV2 in HKEY_CURRENT_USER\Console is checked. */ key ForceV2 in HKEY_CURRENT_USER\Console is checked. */

View 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)) if (!iscygwin () && ptys_primary && is_console_app (runpath))
{ {
bool nopcon = mode != _P_OVERLAY && mode != _P_WAIT; 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; nopcon = true;
if (ptys_primary->setup_pseudoconsole (&si_pcon, nopcon)) if (ptys_primary->setup_pseudoconsole (&si_pcon, nopcon))
{ {