Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-09-05 06:42:49 +0400
committerChristopher Faylor <me@cgf.cx>2001-09-05 06:42:49 +0400
commitd72a655937a014053799df9d6b422a89c88d56e7 (patch)
treec36d34e8647078fcba205d1b3bb0619332977574
parent615a70a882bdff5287f078d50b4991d4dd906ed9 (diff)
* exceptions.cc (ctrl_c_handler): Only send SIGINT when we have a controlling
terminal and we are the head of the process group.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/exceptions.cc8
2 files changed, 8 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 95d999fa9..1d60b7f86 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+Tue Sep 4 22:42:13 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * exceptions.cc (ctrl_c_handler): Only send SIGINT when we have a
+ controlling terminal and we are the head of the process group.
+
Tue Sep 4 16:48:14 2001 Christopher Faylor <cgf@cygnus.com>
* thread.cc (InterlockedExchangePointer): Don't define if it already
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 7a2061aa5..cdeb112e5 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -912,11 +912,8 @@ ctrl_c_handler (DWORD type)
tty_min *t = cygwin_shared->tty.get_tty (myself->ctty);
/* Ignore this if we're not the process group lead since it should be handled
*by* the process group leader. */
- if (t->getpgid () && pid_exists (t->getpgid ()) &&
- (t->getpgid () != myself->pid ||
- (GetTickCount () - t->last_ctrl_c) < MIN_CTRL_C_SLOP))
- return TRUE;
- else
+ if (myself->ctty != -1 && t->getpgid () == myself->pid &&
+ (GetTickCount () - t->last_ctrl_c) >= MIN_CTRL_C_SLOP)
/* Otherwise we just send a SIGINT to the process group and return TRUE (to indicate
that we have handled the signal). At this point, type should be
a CTRL_C_EVENT or CTRL_BREAK_EVENT. */
@@ -926,6 +923,7 @@ ctrl_c_handler (DWORD type)
t->last_ctrl_c = GetTickCount ();
return TRUE;
}
+ return TRUE;
}
/* Set the signal mask for this process.