diff options
Diffstat (limited to 'Parser/intrcheck.c')
-rw-r--r-- | Parser/intrcheck.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Parser/intrcheck.c b/Parser/intrcheck.c index 4636b3f..f5891ee 100644 --- a/Parser/intrcheck.c +++ b/Parser/intrcheck.c @@ -131,7 +131,20 @@ static SIGTYPE intcatcher(sig) int sig; /* Not used by required by interface */ { - interrupted = 1; + extern void goaway PROTO((int)); + static char message[] = +"python: to interrupt a truly hanging Python program, interrupt once more.\n"; + switch (interrupted++) { + case 0: + break; + case 1: + write(2, message, strlen(message)); + break; + case 2: + interrupted = 0; + goaway(1); + break; + } signal(SIGINT, intcatcher); } |