]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #1350409: Port signal handling to VS 2005.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 28 Nov 2005 17:34:23 +0000 (17:34 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 28 Nov 2005 17:34:23 +0000 (17:34 +0000)
Misc/ACKS
Misc/NEWS
Python/pythonrun.c

index 8eebc053f8a90bb9f3a423213871940689829619..e739534cd975fd88ac0f2f04a8f92f36a8c49003 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -113,6 +113,7 @@ David Chaum
 Nicolas Chauvat
 Michael Chermside
 Albert Chin-A-Young
+Adal Chiriliuc
 Tom Christiansen
 Vadim Chugunov
 David Cinege
index cb598d5535b73e214ec71be4f5bb8200debd3228..cd947a923bad359736c4758f573a21c1b04143b4 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@ What's New in Python 2.5 alpha 1?
 Core and builtins
 -----------------
 
+- Patch #1350409: Work around signal handling bug in Visual Studio 2005.
+
 - Bug #1281408: Py_BuildValue now works correct even with unsigned longs
   and long longs.
 
index ad837d28f628f940efcdadb34dc0def26abad2fa..0b14f8bfbc461c2877e1f0d38942c2f66c7d8a87 100644 (file)
@@ -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);