From 17743fbc49ebb23300e0a36d8c5a27ed63e2bf41 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 4 May 2001 20:39:38 +0000 Subject: * exceptions.cc (ctrl_c_handler): Always send signal to process if it has no tty. --- winsup/cygwin/exceptions.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'winsup/cygwin/exceptions.cc') diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 96a2d5953..9f37b00da 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 -- cgit v1.2.3