Kaydet (Commit) fb0df944 authored tarafından Guido van Rossum's avatar Guido van Rossum

Use sigaction if possible

üst 5555854e
...@@ -262,8 +262,14 @@ initsignal() ...@@ -262,8 +262,14 @@ initsignal()
PySignal_SignalHandlerArray[0].tripped = 0; PySignal_SignalHandlerArray[0].tripped = 0;
for (i = 1; i < NSIG; i++) { for (i = 1; i < NSIG; i++) {
RETSIGTYPE (*t)(); RETSIGTYPE (*t)();
#ifdef HAVE_SIGACTION
struct sigaction act;
sigaction(i, 0, &act);
t = act.sa_flags;
#else
t = signal(i, SIG_IGN); t = signal(i, SIG_IGN);
signal(i, t); signal(i, t);
#endif
PySignal_SignalHandlerArray[i].tripped = 0; PySignal_SignalHandlerArray[i].tripped = 0;
if (t == SIG_DFL) if (t == SIG_DFL)
PySignal_SignalHandlerArray[i].func = PySignal_SignalHandlerArray[i].func =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment