Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 61441:435a8355dab6 legacy-trunk
Skip signal handler re-installation if it is not necessary. Issue 8354.
| author | Jean-Paul Calderone <exarkun@divmod.com> |
|---|---|
| date | Sat, 08 May 2010 20:06:02 +0000 |
| parents | 95c400b9d74c |
| children | fd25030223b0 |
comparison
equal
deleted
inserted
replaced
| 61438:4da7fba3370f | 61441:435a8355dab6 |
|---|---|
| 1860 | 1860 |
| 1861 PyOS_sighandler_t | 1861 PyOS_sighandler_t |
| 1862 PyOS_setsig(int sig, PyOS_sighandler_t handler) | 1862 PyOS_setsig(int sig, PyOS_sighandler_t handler) |
| 1863 { | 1863 { |
| 1864 #ifdef HAVE_SIGACTION | 1864 #ifdef HAVE_SIGACTION |
| 1865 /* Some code in Modules/signalmodule.c depends on sigaction() being | |
| 1866 * used here if HAVE_SIGACTION is defined. Fix that if this code | |
| 1867 * changes to invalidate that assumption. | |
| 1868 */ | |
| 1865 struct sigaction context, ocontext; | 1869 struct sigaction context, ocontext; |
| 1866 context.sa_handler = handler; | 1870 context.sa_handler = handler; |
| 1867 sigemptyset(&context.sa_mask); | 1871 sigemptyset(&context.sa_mask); |
| 1868 context.sa_flags = 0; | 1872 context.sa_flags = 0; |
| 1869 if (sigaction(sig, &context, &ocontext) == -1) | 1873 if (sigaction(sig, &context, &ocontext) == -1) |
