aboutsummaryrefslogtreecommitdiff
path: root/src/xz/signals.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2010-10-09 21:51:03 +0300
committerLasse Collin <lasse.collin@tukaani.org>2010-10-09 21:51:03 +0300
commitef364d3abc5647111c5424ea0d83a567e184a23b (patch)
treef246a05dfb60c10e712df321b4cfb4093b44f399 /src/xz/signals.c
parentDOS: Update the Makefile, config.h and README. (diff)
downloadxz-ef364d3abc5647111c5424ea0d83a567e184a23b.tar.xz
OS/2 and DOS: Be less verbose on signals.
Calling raise() to kill xz when user has pressed C-c is a bit verbose on OS/2 and DOS/DJGPP. Instead of calling raise(), set only the exit status to 1.
Diffstat (limited to '')
-rw-r--r--src/xz/signals.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/xz/signals.c b/src/xz/signals.c
index 66d65373..7e65b2a3 100644
--- a/src/xz/signals.c
+++ b/src/xz/signals.c
@@ -142,12 +142,19 @@ signals_exit(void)
const int sig = exit_signal;
if (sig != 0) {
+#ifdef TUKLIB_DOSLIKE
+ // Don't raise(), set only exit status. This avoids
+ // printing unwanted message about SIGINT when the user
+ // presses C-c.
+ set_exit_status(E_ERROR);
+#else
struct sigaction sa;
sa.sa_handler = SIG_DFL;
sigfillset(&sa.sa_mask);
sa.sa_flags = 0;
sigaction(sig, &sa, NULL);
raise(exit_signal);
+#endif
}
return;