public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] Cygwin: pty: Fix a bug in free_attached_console().
@ 2020-05-28  3:43 Takashi Yano
  2020-05-28  7:27 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Takashi Yano @ 2020-05-28  3:43 UTC (permalink / raw)
  To: cygwin-patches

- After commit 7659ff0f5afd751f42485f2684c799c5f37b0fb9, nohup does
  not work as expected. This patch fixes the issue.

  Addresses:
  https://cygwin.com/pipermail/cygwin-developers/2020-May/011885.html
---
 winsup/cygwin/fhandler_tty.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index df08dd20a..f29a2c214 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -188,7 +188,10 @@ set_ishybrid_and_switch_to_pcon (HANDLE h)
 inline void
 fhandler_pty_slave::free_attached_console ()
 {
-  if (freeconsole_on_close && get_minor () == pcon_attached_to)
+  bool attached = get_ttyp () ?
+    fhandler_console::get_console_process_id (get_helper_process_id (), true)
+    : (get_minor () == pcon_attached_to);
+  if (freeconsole_on_close && attached)
     {
       FreeConsole ();
       pcon_attached_to = -1;
-- 
2.26.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Cygwin: pty: Fix a bug in free_attached_console().
  2020-05-28  3:43 [PATCH] Cygwin: pty: Fix a bug in free_attached_console() Takashi Yano
@ 2020-05-28  7:27 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2020-05-28  7:27 UTC (permalink / raw)
  To: cygwin-patches

On May 28 12:43, Takashi Yano via Cygwin-patches wrote:
> - After commit 7659ff0f5afd751f42485f2684c799c5f37b0fb9, nohup does
>   not work as expected. This patch fixes the issue.
> 
>   Addresses:
>   https://cygwin.com/pipermail/cygwin-developers/2020-May/011885.html
> ---
>  winsup/cygwin/fhandler_tty.cc | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
> index df08dd20a..f29a2c214 100644
> --- a/winsup/cygwin/fhandler_tty.cc
> +++ b/winsup/cygwin/fhandler_tty.cc
> @@ -188,7 +188,10 @@ set_ishybrid_and_switch_to_pcon (HANDLE h)
>  inline void
>  fhandler_pty_slave::free_attached_console ()
>  {
> -  if (freeconsole_on_close && get_minor () == pcon_attached_to)
> +  bool attached = get_ttyp () ?
> +    fhandler_console::get_console_process_id (get_helper_process_id (), true)
> +    : (get_minor () == pcon_attached_to);
> +  if (freeconsole_on_close && attached)
>      {
>        FreeConsole ();
>        pcon_attached_to = -1;
> -- 
> 2.26.2

Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-28  7:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28  3:43 [PATCH] Cygwin: pty: Fix a bug in free_attached_console() Takashi Yano
2020-05-28  7:27 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).