summaryrefslogtreecommitdiff
path: root/src/httrack.c
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2012-03-19 13:04:25 +0000
committerXavier Roche <xroche@users.noreply.github.com>2012-03-19 13:04:25 +0000
commit388b7dee2a2d558c0ee576a9213b5ea422a56c77 (patch)
tree4c0f66930ae08593dd39134395b42bcec7a15d61 /src/httrack.c
parent0183f4dd84d8cc44d617fb48436881e79e2bf0f2 (diff)
httrack 3.45.1
Diffstat (limited to 'src/httrack.c')
-rw-r--r--src/httrack.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/httrack.c b/src/httrack.c
index d1f2f77..adc8ca6 100644
--- a/src/httrack.c
+++ b/src/httrack.c
@@ -772,11 +772,22 @@ static void sig_doback(int blind) { // mettre en backing
}
#endif
+static void sig_leave( int code ) {
+ signal(code, sig_term); // quitter si encore
+ printf("\n** Finishing pending transfers.. press again ^C to quit.\n");
+ if (global_opt != NULL) {
+ // ask for stop
+ global_opt->state.stop=1;
+ }
+}
+
static void signal_handlers(void) {
#ifdef _WIN32
#ifndef _WIN32_WCE
#if 0 /* BUG366763 */
signal( SIGINT , sig_ask ); // ^C
+#else
+ signal( SIGINT , sig_leave ); // ^C
#endif
signal( SIGTERM , sig_finish ); // kill <process>
#endif
@@ -788,6 +799,8 @@ static void signal_handlers(void) {
signal( SIGTERM , sig_finish ); // kill <process>
#if 0 /* BUG366763 */
signal( SIGINT , sig_ask ); // ^C
+#else
+ signal( SIGINT , sig_leave ); // ^C
#endif
signal( SIGPIPE , sig_brpipe ); // broken pipe (write into non-opened socket)
signal( SIGCHLD , sig_ignore ); // child change status