diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2010-06-02 21:32:12 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2010-06-02 21:32:12 +0300 |
commit | 29a7b250e685852f2f97615493ec49acaf528623 (patch) | |
tree | 2d3b39bb8a9d32b070974668c06925b36317f26a /src/xz/signals.c | |
parent | Adjust SA_RESTART workaround. (diff) | |
download | xz-29a7b250e685852f2f97615493ec49acaf528623.tar.xz |
Fix a Windows-specific FIXME in signal handling code.
Diffstat (limited to 'src/xz/signals.c')
-rw-r--r-- | src/xz/signals.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/xz/signals.c b/src/xz/signals.c index 807b0225..66d65373 100644 --- a/src/xz/signals.c +++ b/src/xz/signals.c @@ -156,11 +156,14 @@ signals_exit(void) #else // While Windows has some very basic signal handling functions as required -// by C89, they are not really used, or so I understood. Instead, we use -// SetConsoleCtrlHandler() to catch user pressing C-c. - -#include <windows.h> - +// by C89, they are not really used, and e.g. SIGINT doesn't work exactly +// the way it does on POSIX (Windows creates a new thread for the signal +// handler). Instead, we use SetConsoleCtrlHandler() to catch user +// pressing C-c, because that seems to be the recommended way to do it. +// +// NOTE: This doesn't work under MSYS. Trying with SIGINT doesn't work +// either even if it appeared to work at first. So test using Windows +// console window. static BOOL WINAPI signal_handler(DWORD type lzma_attribute((unused))) @@ -168,9 +171,6 @@ signal_handler(DWORD type lzma_attribute((unused))) // Since we don't get a signal number which we could raise() at // signals_exit() like on POSIX, just set the exit status to // indicate an error, so that we cannot return with zero exit status. - // - // FIXME: Since this function runs in its own thread, - // set_exit_status() should have a mutex. set_exit_status(E_ERROR); user_abort = true; return TRUE; |