From 41ff9d8c7d4f1224b594eee921b6a966a0585d72 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 7 Sep 2005 03:10:17 +0000 Subject: * dcrt0.cc (initial_env): Don't attempt stracing if dynamically loaded. (dll_crt0_0): Move console initialization earlier. * init.cc (dll_entry): Move console initialization here. * exceptions.cc (init_console_handler): Fully remove any old console handler. * spawn.cc (spawn_guts): Don't fill out windows argv if we've deduced that this is a cygwin-using program. (av::fixup): Always check executables to see if they are using cygwin1.dll. Don't consider .com files to be scripts. * hookapi.cc (rvadelta): New function. (PEHeaderFromHModule): Simplify slightly. (hook_or_detect_cygwin): Use passed in name argument for "HMODULE" rather than incorrectly reading current program. Calculate delta needed to read image data and file names if this isn't a real "HMODULE". --- winsup/cygwin/exceptions.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/exceptions.cc') diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 852b5019f..2f9567e09 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -123,7 +123,8 @@ void init_console_handler (BOOL install_handler) { BOOL res; - SetConsoleCtrlHandler (ctrl_c_handler, FALSE); + while (SetConsoleCtrlHandler (ctrl_c_handler, FALSE)) + continue; if (install_handler) res = SetConsoleCtrlHandler (ctrl_c_handler, TRUE); else if (wincap.has_null_console_handler_routine ()) @@ -591,7 +592,11 @@ int __stdcall handle_sigsuspend (sigset_t tempmask) { if (&_my_tls != _main_tls) - Sleep (INFINITE); + { + cancelable_wait (signal_arrived, INFINITE, cw_cancel_self); + return -1; + } + sigset_t oldmask = myself->getsigmask (); // Remember for restoration set_signal_mask (tempmask, myself->getsigmask ()); @@ -845,6 +850,11 @@ ctrl_c_handler (DWORD type) _my_tls.remove (INFINITE); +#if 0 + if (type == CTRL_C_EVENT || type == CTRL_BREAK_EVENT) + proc_subproc (PROC_KILLFORKED, 0); +#endif + /* Return FALSE to prevent an "End task" dialog box from appearing for each Cygwin process window that's open when the computer is shut down or console window is closed. */ -- cgit v1.2.3