diff options
| author | Guido van Rossum <guido@python.org> | 1997-08-02 03:02:27 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 1997-08-02 03:02:27 +0000 |
| commit | 767c85156c7beffcd865ac8eac652ccbee07eda4 (patch) | |
| tree | 90d83ad033fa370448ede1a2dcfbf488e7d47ef9 /Parser/intrcheck.c | |
| parent | ef74f756c041d66564b8ce9bf776c7c817037ae0 (diff) | |
| download | cpython-767c85156c7beffcd865ac8eac652ccbee07eda4.tar.gz | |
Added finalization routines.
Diffstat (limited to 'Parser/intrcheck.c')
| -rw-r--r-- | Parser/intrcheck.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Parser/intrcheck.c b/Parser/intrcheck.c index 685e066778..a2a31452bb 100644 --- a/Parser/intrcheck.c +++ b/Parser/intrcheck.c @@ -49,6 +49,11 @@ PyOS_InitInterrupts() { } +void +PyOS_FiniInterrupts() +{ +} + int PyOS_InterruptOccurred() { @@ -81,6 +86,11 @@ PyOS_InitInterrupts() _go32_want_ctrl_break(1 /* TRUE */); } +void +PyOS_FiniInterrupts() +{ +} + int PyOS_InterruptOccurred() { @@ -96,6 +106,11 @@ PyOS_InitInterrupts() { } +void +PyOS_FiniInterrupts() +{ +} + int PyOS_InterruptOccurred() { @@ -170,10 +185,12 @@ intcatcher(sig) Py_AddPendingCall(PyErr_CheckSignals, NULL); } +static RETSIGTYPE (*old_siginthandler)() = SIG_DFL; + void PyOS_InitInterrupts() { - if (signal(SIGINT, SIG_IGN) != SIG_IGN) + if ((old_siginthandler = signal(SIGINT, SIG_IGN)) != SIG_IGN) signal(SIGINT, intcatcher); #ifdef HAVE_SIGINTERRUPT /* This is for SunOS and other modern BSD derivatives. @@ -186,6 +203,12 @@ PyOS_InitInterrupts() #endif /* HAVE_SIGINTERRUPT */ } +void +PyOS_FiniInterrupts() +{ + signal(SIGINT, old_siginthandler); +} + int PyOS_InterruptOccurred() { |
