[PATCH] Cygwin: console, pty: Prevent error in legacy console mode.

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Nov 6 14:05:00 GMT 2019


Hi Takashi,

the patch is fine in general.  Still, what I really like to see is a
descriptive log message, as well as a matching comment...

On Nov  6 20:59, Takashi Yano wrote:
> @@ -3131,6 +3134,16 @@ fhandler_pty_master::setup_pseudoconsole ()
>        if (res != S_OK)
>  	system_printf ("CreatePseudoConsole() failed. %08x\n",
>  		       GetLastError ());
> +      error = true;
> +    }
> +

...here, to explain briefly why this check is done.

> +  reg_key reg (HKEY_CURRENT_USER, KEY_READ, L"Console", NULL);
> +  if (reg.error ())
> +    error = true;
> +  if (reg.get_dword (L"ForceV2", 1) == 0)
> +    error = true;
> +  if (error)
> +    {
>        CloseHandle (from_master);
>        CloseHandle (to_slave);
>        from_master = from_master_cyg;
> -- 
> 2.21.0

Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20191106/7bd80d8e/attachment.sig>


More information about the Cygwin-patches mailing list