Fossil SCM

In "fossil sqlite", if three or more interrupt signals (control-c) are received in a row without a response from sqlite3_interrupt() then call exit(1) immediately. This allows control-C to interrupt the shell even if it is stuck in a computation or loop that does not involve the VDBE.

jan.nijtmans 2014-05-24 06:27 trunk
Commit a74d100a121219b8ae9ed5500b58c5b89b7d3d7f
1 file changed +2 -1
+2 -1
--- src/shell.c
+++ src/shell.c
@@ -695,11 +695,12 @@
695695
/*
696696
** This routine runs when the user presses Ctrl-C
697697
*/
698698
static void interrupt_handler(int NotUsed){
699699
UNUSED_PARAMETER(NotUsed);
700
- seenInterrupt = 1;
700
+ seenInterrupt++;
701
+ if( seenInterrupt>2 ) exit(1);
701702
if( db ) sqlite3_interrupt(db);
702703
}
703704
#endif
704705
705706
/*
706707
--- src/shell.c
+++ src/shell.c
@@ -695,11 +695,12 @@
695 /*
696 ** This routine runs when the user presses Ctrl-C
697 */
698 static void interrupt_handler(int NotUsed){
699 UNUSED_PARAMETER(NotUsed);
700 seenInterrupt = 1;
 
701 if( db ) sqlite3_interrupt(db);
702 }
703 #endif
704
705 /*
706
--- src/shell.c
+++ src/shell.c
@@ -695,11 +695,12 @@
695 /*
696 ** This routine runs when the user presses Ctrl-C
697 */
698 static void interrupt_handler(int NotUsed){
699 UNUSED_PARAMETER(NotUsed);
700 seenInterrupt++;
701 if( seenInterrupt>2 ) exit(1);
702 if( db ) sqlite3_interrupt(db);
703 }
704 #endif
705
706 /*
707

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button