summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2005-11-28 17:34:23 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2005-11-28 17:34:23 (GMT)
commitb45b315855f5523d2aa5c3ad685c2c9530d42229 (patch)
tree6af726e7f3dbff8523ac64a0bead87e427fb59f5 /Python
parent3a9a3e7864a6c04f2dce5522dfa7af434a97f9a8 (diff)
downloadcpython-b45b315855f5523d2aa5c3ad685c2c9530d42229.zip
cpython-b45b315855f5523d2aa5c3ad685c2c9530d42229.tar.gz
cpython-b45b315855f5523d2aa5c3ad685c2c9530d42229.tar.bz2
Patch #1350409: Port signal handling to VS 2005.
Diffstat (limited to 'Python')
-rw-r--r--Python/pythonrun.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index ad837d2..0b14f8b 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1615,6 +1615,23 @@ PyOS_getsig(int sig)
return context.sa_handler;
#else
PyOS_sighandler_t handler;
+/* Special signal handling for the secure CRT in Visual Studio 2005 */
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ switch (sig) {
+ /* Only these signals are valid */
+ case SIGINT:
+ case SIGILL:
+ case SIGFPE:
+ case SIGSEGV:
+ case SIGTERM:
+ case SIGBREAK:
+ case SIGABRT:
+ break;
+ /* Don't call signal() with other values or it will assert */
+ default:
+ return SIG_ERR;
+ }
+#endif /* _MSC_VER && _MSC_VER >= 1400 */
handler = signal(sig, SIG_IGN);
if (handler != SIG_ERR)
signal(sig, handler);