Commit 904e1d67 authored by sof's avatar sof
Browse files

[project @ 2003-10-21 03:38:07 by sof]

stg_InstallConsoleEvent(): registering generic_handler() once will do
parent 1820f42c
......@@ -83,7 +83,6 @@ void initDefaultHandlers(void)
if ( !SetConsoleCtrlHandler(shutdown_handler, TRUE) ) {
prog_belch("warning: failed to install default console handler");
}
}
......@@ -221,8 +220,11 @@ stg_InstallConsoleEvent(int action, StgStablePtr *handler)
break;
case STG_SIG_HAN:
console_handler = (StgInt)*handler;
if ( !SetConsoleCtrlHandler(generic_handler, TRUE) ) {
if ( previous_hdlr < 0 ) {
/* Only install generic_handler() once */
if ( !SetConsoleCtrlHandler(generic_handler, TRUE) ) {
prog_belch("warning: unable to install console event handler");
}
}
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment