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.
Commit
a74d100a121219b8ae9ed5500b58c5b89b7d3d7f
Parent
03f0317c7982112…
1 file changed
+2
-1
+2
-1
| --- src/shell.c | ||
| +++ src/shell.c | ||
| @@ -695,11 +695,12 @@ | ||
| 695 | 695 | /* |
| 696 | 696 | ** This routine runs when the user presses Ctrl-C |
| 697 | 697 | */ |
| 698 | 698 | static void interrupt_handler(int NotUsed){ |
| 699 | 699 | UNUSED_PARAMETER(NotUsed); |
| 700 | - seenInterrupt = 1; | |
| 700 | + seenInterrupt++; | |
| 701 | + if( seenInterrupt>2 ) exit(1); | |
| 701 | 702 | if( db ) sqlite3_interrupt(db); |
| 702 | 703 | } |
| 703 | 704 | #endif |
| 704 | 705 | |
| 705 | 706 | /* |
| 706 | 707 |
| --- 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 |