Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 35961:72555a967d6a legacy-trunk
Patch #1350409: Port signal handling to VS 2005.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Mon, 28 Nov 2005 17:34:23 +0000 |
| parents | 1c4d192f1568 |
| children | ea083efdc96c |
comparison
equal
deleted
inserted
replaced
| 35960:658444baeba3 | 35961:72555a967d6a |
|---|---|
| 1613 if (sigaction(sig, NULL, &context) == -1) | 1613 if (sigaction(sig, NULL, &context) == -1) |
| 1614 return SIG_ERR; | 1614 return SIG_ERR; |
| 1615 return context.sa_handler; | 1615 return context.sa_handler; |
| 1616 #else | 1616 #else |
| 1617 PyOS_sighandler_t handler; | 1617 PyOS_sighandler_t handler; |
| 1618 /* Special signal handling for the secure CRT in Visual Studio 2005 */ | |
| 1619 #if defined(_MSC_VER) && _MSC_VER >= 1400 | |
| 1620 switch (sig) { | |
| 1621 /* Only these signals are valid */ | |
| 1622 case SIGINT: | |
| 1623 case SIGILL: | |
| 1624 case SIGFPE: | |
| 1625 case SIGSEGV: | |
| 1626 case SIGTERM: | |
| 1627 case SIGBREAK: | |
| 1628 case SIGABRT: | |
| 1629 break; | |
| 1630 /* Don't call signal() with other values or it will assert */ | |
| 1631 default: | |
| 1632 return SIG_ERR; | |
| 1633 } | |
| 1634 #endif /* _MSC_VER && _MSC_VER >= 1400 */ | |
| 1618 handler = signal(sig, SIG_IGN); | 1635 handler = signal(sig, SIG_IGN); |
| 1619 if (handler != SIG_ERR) | 1636 if (handler != SIG_ERR) |
| 1620 signal(sig, handler); | 1637 signal(sig, handler); |
| 1621 return handler; | 1638 return handler; |
| 1622 #endif | 1639 #endif |
