[PATCH] Cygwin: console: Make suspending process work properly.

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

[PATCH] Cygwin: console: Make suspending process work properly.

Takashi Yano
- After commit f4b47827cf87f055687a0c52a3485d42b3e2b941, suspending
  process by Ctrl-Z does not work in console and results in hang up.
  This patch fixes the issue.
---
 winsup/cygwin/fhandler_console.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 78f42999c..33ff8371f 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -853,7 +853,9 @@ fhandler_console::process_input_message (void)
       if (toadd)
  {
   ssize_t ret;
+  release_input_mutex ();
   line_edit_status res = line_edit (toadd, nread, *ti, &ret);
+  acquire_input_mutex (INFINITE);
   if (res == line_edit_signalled)
     {
       stat = input_signalled;
--
2.21.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Cygwin: console: Make suspending process work properly.

Corinna Vinschen-2
On Jan  5 22:25, Takashi Yano wrote:

> - After commit f4b47827cf87f055687a0c52a3485d42b3e2b941, suspending
>   process by Ctrl-Z does not work in console and results in hang up.
>   This patch fixes the issue.
> ---
>  winsup/cygwin/fhandler_console.cc | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
> index 78f42999c..33ff8371f 100644
> --- a/winsup/cygwin/fhandler_console.cc
> +++ b/winsup/cygwin/fhandler_console.cc
> @@ -853,7 +853,9 @@ fhandler_console::process_input_message (void)
>        if (toadd)
>   {
>    ssize_t ret;
> +  release_input_mutex ();
>    line_edit_status res = line_edit (toadd, nread, *ti, &ret);
> +  acquire_input_mutex (INFINITE);
>    if (res == line_edit_signalled)
>      {
>        stat = input_signalled;
> --
> 2.21.0
Pushed.


Thanks,
Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment