[PATCH v2 0/1] Cygwin: Fix incorrect TTY for non-cygwin process.

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

[PATCH v2 0/1] Cygwin: Fix incorrect TTY for non-cygwin process.

Takashi Yano
- After commit d4045fdbef60d8e7e0d11dfe38b048ea2cb8708b, the TTY
  displayed by ps command is incorrect if the process is non-cygwin
  process. This patch fixes this issue.

v2:
Simplify the condition to call proc_subproc (PROC_CLEARWAIT, 1) in
exceptions.cc.

Takashi Yano (1):
  Cygwin: Fix incorrect TTY for non-cygwin process.

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

--
2.21.0

Reply | Threaded
Open this post in threaded view
|

[PATCH v2 1/1] Cygwin: Fix incorrect TTY for non-cygwin process.

Takashi Yano
- After commit d4045fdbef60d8e7e0d11dfe38b048ea2cb8708b, the TTY
  displayed by ps command is incorrect if the process is non-cygwin
  process. This patch fixes this issue.
---
 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 848f9bd68..db0fe0867 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 4396ec9e5..4d8bcc9fa 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
--
2.21.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/1] Cygwin: Fix incorrect TTY for non-cygwin process.

Ken Brown-6
In reply to this post by Takashi Yano
On 9/19/2019 11:04 PM, Takashi Yano wrote:

> - After commit d4045fdbef60d8e7e0d11dfe38b048ea2cb8708b, the TTY
>    displayed by ps command is incorrect if the process is non-cygwin
>    process. This patch fixes this issue.
>
> v2:
> Simplify the condition to call proc_subproc (PROC_CLEARWAIT, 1) in
> exceptions.cc.
>
> Takashi Yano (1):
>    Cygwin: Fix incorrect TTY for non-cygwin process.
>
>   winsup/cygwin/exceptions.cc | 2 +-
>   winsup/cygwin/spawn.cc      | 5 +----
>   2 files changed, 2 insertions(+), 5 deletions(-)

Pushed.  Thanks.

Ken