diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-10-11 19:32:49 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-10-13 03:27:21 +0200 |
commit | 93e91faddff54b9debc45684eeeb1e322902bdfa (patch) | |
tree | 04c88a397c7cc4e3b32bc8c3f0a5b96872eeb260 /crawl-ref/source/libutil.cc | |
parent | cc301ba6b63996bc5e0d20748c3c0640b59409ec (diff) | |
download | crawl-ref-93e91faddff54b9debc45684eeeb1e322902bdfa.tar.gz crawl-ref-93e91faddff54b9debc45684eeeb1e322902bdfa.zip |
Allow easily aborting mapstat.
Ctrl-C should probably be enabled during database rebuild, too.
Diffstat (limited to 'crawl-ref/source/libutil.cc')
-rw-r--r-- | crawl-ref/source/libutil.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc index c3b495af79..294c88857f 100644 --- a/crawl-ref/source/libutil.cc +++ b/crawl-ref/source/libutil.cc @@ -1210,6 +1210,11 @@ void init_signals() SetConsoleCtrlHandler(console_handler, true); } +void release_cli_signals() +{ + SetConsoleCtrlHandler(nullptr, false); +} + void text_popup(const string& text, const wchar_t *caption) { MessageBoxW(0, OUTW(text), caption, MB_OK); @@ -1278,4 +1283,12 @@ void init_signals() #endif } +void release_cli_signals() +{ +#ifdef USE_UNIX_SIGNALS + signal(SIGQUIT, SIG_DFL); + signal(SIGINT, SIG_DFL); +#endif +} + #endif |