public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Takashi Yano <tyan0@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/cygwin-3_3-branch] Cygwin: console: Revert experimental code mixed accidentally. Date: Sat, 26 Feb 2022 15:36:43 +0000 (GMT) [thread overview] Message-ID: <20220226153643.D72633858D35@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f6ef457ad212690f16e4ff9bc378944500463d4c commit f6ef457ad212690f16e4ff9bc378944500463d4c Author: Takashi Yano <takashi.yano@nifty.ne.jp> Date: Sat Feb 26 23:31:59 2022 +0900 Cygwin: console: Revert experimental code mixed accidentally. - The commit "Cygwin: console: Restore CTRL_BREAK_EVENT handling." was accidentally mixed with experimental code in exceptions.cc. Due to this, non-cygwin app receives CTRL_C_EVENT twice in the following scenario. 1) Run 'sleep 10 | <non-cygwin app>' 2) Hit Ctrl-C. 3) The non-cygwin app receives CTRL_C_EVENT twice. This patch reverts the code with the problem. Diff: --- winsup/cygwin/exceptions.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 73bf68939..6e0b862c7 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1174,8 +1174,14 @@ ctrl_c_handler (DWORD type) (to indicate that we have handled the signal). At this point, type should be a CTRL_C_EVENT or CTRL_BREAK_EVENT. */ { + int sig = SIGINT; + /* If intr and quit are both mapped to ^C, send SIGQUIT on ^BREAK */ + if (type == CTRL_BREAK_EVENT + && t->ti.c_cc[VINTR] == 3 && t->ti.c_cc[VQUIT] == 3) + sig = SIGQUIT; t->last_ctrl_c = GetTickCount64 (); - fhandler_termios::process_sigs ('\003', (tty *) t, ::cygheap->ctty); + t->kill_pgrp (sig); + t->output_stopped = false; t->last_ctrl_c = GetTickCount64 (); return TRUE; }
reply other threads:[~2022-02-26 15:36 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=20220226153643.D72633858D35@sourceware.org \ --to=tyan0@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: linkBe 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).