summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/exceptions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index dabfeab62..279223e58 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -104,8 +104,9 @@ init_console_handler (bool install_handler)
{
BOOL res;
- while (SetConsoleCtrlHandler (ctrl_c_handler, FALSE))
- continue;
+ SetConsoleCtrlHandler (ctrl_c_handler, FALSE);
+ if (wincap.has_null_console_handler_routine ())
+ SetConsoleCtrlHandler (NULL, FALSE);
if (install_handler)
res = SetConsoleCtrlHandler (ctrl_c_handler, TRUE);
else if (wincap.has_null_console_handler_routine ())
@@ -114,7 +115,6 @@ init_console_handler (bool install_handler)
res = SetConsoleCtrlHandler (dummy_ctrl_c_handler, TRUE);
if (!res)
system_printf ("SetConsoleCtrlHandler failed, %E");
- return;
}
extern "C" void