[PATCH] Cygwin: console: Fix code for restoring console mode.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Cygwin: console: Fix code for restoring console mode.

Takashi Yano
- Commit 774b8996d1f3e535e8267be4eb8e751d756c2cec has a bug that
  restores console output mode into console input. This patch fixes
  the issue.
---
 winsup/cygwin/fhandler_console.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 2afb5c529..9bfee64d3 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -1122,7 +1122,7 @@ fhandler_console::close ()
   &obi, sizeof obi, NULL);
   if (NT_SUCCESS (status) && obi.HandleCount == 1)
     if (orig_conout_mode != (DWORD) -1)
-      SetConsoleMode (get_handle (), orig_conout_mode);
+      SetConsoleMode (get_output_handle (), orig_conout_mode);
 
   release_output_mutex ();
 
--
2.21.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Cygwin: console: Fix code for restoring console mode.

Corinna Vinschen-2
On Feb 17 21:46, Takashi Yano wrote:

> - Commit 774b8996d1f3e535e8267be4eb8e751d756c2cec has a bug that
>   restores console output mode into console input. This patch fixes
>   the issue.
> ---
>  winsup/cygwin/fhandler_console.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
> index 2afb5c529..9bfee64d3 100644
> --- a/winsup/cygwin/fhandler_console.cc
> +++ b/winsup/cygwin/fhandler_console.cc
> @@ -1122,7 +1122,7 @@ fhandler_console::close ()
>    &obi, sizeof obi, NULL);
>    if (NT_SUCCESS (status) && obi.HandleCount == 1)
>      if (orig_conout_mode != (DWORD) -1)
> -      SetConsoleMode (get_handle (), orig_conout_mode);
> +      SetConsoleMode (get_output_handle (), orig_conout_mode);
>  
>    release_output_mutex ();
>  
> --
> 2.21.0
I pushed this now, but I let it simmering for a bit.  I'll create the
3.1.4 release tomorrow.


Thanks,
Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment