[newlib-cygwin] Cygwin: Fix incorrect TTY for non-cygwin process.

Ken Brown kbrown@sourceware.org
Fri Sep 20 21:59:00 GMT 2019


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

commit 41864091014b63b0cb72ae98281fa53349b6ef77
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Fri Sep 20 12:04:36 2019 +0900

    Cygwin: Fix incorrect TTY for non-cygwin process.
    
    - After commit d4045fdbef60d8e7e0d11dfe38b048ea2cb8708b, the TTY
      displayed by ps command is incorrect if the process is non-cygwin
      process. This patch fixes this issue.

Diff:
---
 winsup/cygwin/exceptions.cc | 2 +-
 winsup/cygwin/spawn.cc      | 5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 848f9bd..db0fe08 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -949,7 +949,7 @@ _cygtls::interrupt_setup (siginfo_t& si, void *handler, struct sigaction& siga)
   if (incyg)
     set_signal_arrived ();
 
-  if (!have_execed)
+  if (!have_execed && ch_spawn.iscygwin ())
     proc_subproc (PROC_CLEARWAIT, 1);
   sigproc_printf ("armed signal_arrived %p, signal %d",
 		  signal_arrived, si.si_signo);
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 4396ec9..4d8bcc9 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -622,10 +622,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
       si.cb = sizeof (si);
 
       if (!iscygwin ())
-	{
-	  init_console_handler (myself->ctty > 0);
-	  myself->ctty = 0;
-	}
+	init_console_handler (myself->ctty > 0);
 
     loop:
       /* When ruid != euid we create the new process under the current original



More information about the Cygwin-cvs mailing list