mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Patch #1350409: Port signal handling to VS 2005.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user