summaryrefslogtreecommitdiffstats
path: root/Parser/intrcheck.c
diff options
context:
space:
mode:
authorAnthony Baxter <anthonybaxter@gmail.com>2004-10-13 14:48:50 (GMT)
committerAnthony Baxter <anthonybaxter@gmail.com>2004-10-13 14:48:50 (GMT)
commit9ceaa72ebe96cb5423aa3fb2adede3fcd1c7b6b0 (patch)
tree89e6ac6b3f1ec58c13296765e2301b854a6150d6 /Parser/intrcheck.c
parent7d428788e156200df2f8e6421cad9fce083fd96b (diff)
downloadcpython-9ceaa72ebe96cb5423aa3fb2adede3fcd1c7b6b0.zip
cpython-9ceaa72ebe96cb5423aa3fb2adede3fcd1c7b6b0.tar.gz
cpython-9ceaa72ebe96cb5423aa3fb2adede3fcd1c7b6b0.tar.bz2
Patch #975056 - fixes for restartable signals on *BSD. In addition,
a few remaining calls to signal() were converted to PyOS_setsig().
Diffstat (limited to 'Parser/intrcheck.c')
-rw-r--r--Parser/intrcheck.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/Parser/intrcheck.c b/Parser/intrcheck.c
index f7434af..e0f3252 100644
--- a/Parser/intrcheck.c
+++ b/Parser/intrcheck.c
@@ -137,7 +137,7 @@ intcatcher(int sig)
Py_Exit(1);
break;
}
- signal(SIGINT, intcatcher);
+ PyOS_setsig(SIGINT, intcatcher);
Py_AddPendingCall(checksignals_witharg, NULL);
}
@@ -146,23 +146,14 @@ static void (*old_siginthandler)(int) = SIG_DFL;
void
PyOS_InitInterrupts(void)
{
- if ((old_siginthandler = signal(SIGINT, SIG_IGN)) != SIG_IGN)
- signal(SIGINT, intcatcher);
-#ifdef HAVE_SIGINTERRUPT
- /* This is for SunOS and other modern BSD derivatives.
- It means that system calls (like read()) are not restarted
- after an interrupt. This is necessary so interrupting a
- read() or readline() call works as expected.
- XXX On old BSD (pure 4.2 or older) you may have to do this
- differently! */
- siginterrupt(SIGINT, 1);
-#endif /* HAVE_SIGINTERRUPT */
+ if ((old_siginthandler = PyOS_setsig(SIGINT, SIG_IGN)) != SIG_IGN)
+ PyOS_setsig(SIGINT, intcatcher);
}
void
PyOS_FiniInterrupts(void)
{
- signal(SIGINT, old_siginthandler);
+ PyOS_setsig(SIGINT, old_siginthandler);
}
int