From b45b315855f5523d2aa5c3ad685c2c9530d42229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 28 Nov 2005 17:34:23 +0000 Subject: Patch #1350409: Port signal handling to VS 2005. --- Python/pythonrun.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index ad837d28f6..0b14f8bfbc 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); -- cgit v1.2.1