public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/cygwin-3_3-branch] Cygwin: console: Prevent the exec'ed bash from exiting by Ctrl-C.
@ 2021-11-03 14:12 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2021-11-03 14:12 UTC (permalink / raw)
  To: cygwin-cvs

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

commit b3d2f35cb1a62daf92d88e1aecc2a235d843dbca
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Wed Nov 3 15:14:42 2021 +0900

    Cygwin: console: Prevent the exec'ed bash from exiting by Ctrl-C.
    
    - Currently, bash occasionally exits by Ctrl-C with the following
      scenario.
        1) Start bash in the command prompt.
        2) Run 'exec bash'.
        3) Press Ctrl-C several times.
      This patch fixes the issue.

Diff:
---
 winsup/cygwin/sigproc.cc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 47352c213..dff797915 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -594,6 +594,14 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
       p = myself;
     }
 
+  /* If myself is the stub process, send signal to the child process
+     rather than myself. The fact that myself->dwProcessId is not equal
+     to the current process id indicates myself is the stub process. */
+  if (its_me && myself->dwProcessId != GetCurrentProcessId ())
+    {
+      wait_for_completion = false;
+      its_me = false;
+    }
 
   if (its_me)
     sendsig = my_sendsig;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-03 14:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 14:12 [newlib-cygwin/cygwin-3_3-branch] Cygwin: console: Prevent the exec'ed bash from exiting by Ctrl-C 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).