aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/exceptions.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-05-04 20:39:38 +0000
committerChristopher Faylor <me@cgf.cx>2001-05-04 20:39:38 +0000
commit17743fbc49ebb23300e0a36d8c5a27ed63e2bf41 (patch)
tree5ac0733972c757a0b3b75229f419add2a0a33902 /winsup/cygwin/exceptions.cc
parent8b3bcfbab9d0a96b133d6076971ea11bfd52e288 (diff)
downloadnewlib-17743fbc49ebb23300e0a36d8c5a27ed63e2bf41.zip
newlib-17743fbc49ebb23300e0a36d8c5a27ed63e2bf41.tar.gz
newlib-17743fbc49ebb23300e0a36d8c5a27ed63e2bf41.tar.bz2
* exceptions.cc (ctrl_c_handler): Always send signal to process if it has no
tty.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 96a2d59..9f37b00 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -632,11 +632,11 @@ bool
sigthread::get_winapi_lock (int test)
{
if (test)
- return !InterlockedExchange (&winapi_lock, 1);
+ return !ilockexch (&winapi_lock, 1);
/* Need to do a busy loop because we can't block or a potential SuspendThread
will hang. */
- while (InterlockedExchange (&winapi_lock, 1))
+ while (ilockexch (&winapi_lock, 1))
Sleep (1);
return 1;
}
@@ -645,7 +645,7 @@ void
sigthread::release_winapi_lock ()
{
/* Assumes that we have the lock. */
- InterlockedExchange (&winapi_lock, 0);
+ ilockexch (&winapi_lock, 0);
}
static void __stdcall interrupt_setup (int sig, void *handler, DWORD retaddr,
@@ -892,8 +892,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 () || t->getpgid () != myself->pid ||
- (GetTickCount () - t->last_ctrl_c) < MIN_CTRL_C_SLOP)
+ if (t->getpgid () && (t->getpgid () != myself->pid ||
+ (GetTickCount () - t->last_ctrl_c) < MIN_CTRL_C_SLOP))
return TRUE;
else
/* Otherwise we just send a SIGINT to the process group and return TRUE (to indicate