public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: pty: Fix a bug in free_attached_console().
Date: Thu, 28 May 2020 07:26:54 +0000 (GMT)	[thread overview]
Message-ID: <20200528072654.1C5BC386F46B@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=25987b2c2a49013ce6d8c9d2ab29a92eb05f9482

commit 25987b2c2a49013ce6d8c9d2ab29a92eb05f9482
Author: Takashi Yano via Cygwin-patches <cygwin-patches@cygwin.com>
Date:   Thu May 28 12:43:05 2020 +0900

    Cygwin: pty: Fix a bug in free_attached_console().
    
    - 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

Diff:
---
 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;


                 reply	other threads:[~2020-05-28  7:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200528072654.1C5BC386F46B@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).