public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: pty: Add a workaround for ^C handling.
@ 2019-09-04 14:04 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2019-09-04 14:04 UTC (permalink / raw)
  To: cygwin-cvs

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

commit d4045fdbef60d8e7e0d11dfe38b048ea2cb8708b
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Wed Sep 4 22:47:42 2019 +0900

    Cygwin: pty: Add a workaround for ^C handling.
    
    - Pseudo console support introduced by commit
      169d65a5774acc76ce3f3feeedcbae7405aa9b57 sometimes cause random
      crash or freeze by pressing ^C while cygwin and non-cygwin
      processes are executed simultaneously in the same pty. This
      patch is a workaround for this issue.

Diff:
---
 winsup/cygwin/fork.cc  | 1 -
 winsup/cygwin/spawn.cc | 6 ++++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index a3a7e75..0a929df 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -213,7 +213,6 @@ frok::child (volatile char * volatile here)
      - terminate the current fork call even if the child is initialized. */
   sync_with_parent ("performed fork fixups and dynamic dll loading", true);
 
-  init_console_handler (myself->ctty > 0);
   ForceCloseHandle1 (fork_info->forker_finished, forker_finished);
 
   pthread::atforkchild ();
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 4bb28c4..15cba36 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -635,6 +635,12 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
       if (ptys)
 	ptys->fixup_after_attach (!iscygwin ());
 
+      if (!iscygwin ())
+	{
+	  init_console_handler (myself->ctty > 0);
+	  myself->ctty = 0;
+	}
+
     loop:
       /* When ruid != euid we create the new process under the current original
 	 account and impersonate in child, this way maintaining the different


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

only message in thread, other threads:[~2019-09-04 14:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 14:04 [newlib-cygwin] Cygwin: pty: Add a workaround for ^C handling 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).