Use sigaction if possible

This commit is contained in:
Guido van Rossum 1996-05-23 22:55:35 +00:00
parent 5555854e85
commit fb0df944ca
1 changed files with 6 additions and 0 deletions

View File

@ -262,8 +262,14 @@ initsignal()
PySignal_SignalHandlerArray[0].tripped = 0;
for (i = 1; i < NSIG; i++) {
RETSIGTYPE (*t)();
#ifdef HAVE_SIGACTION
struct sigaction act;
sigaction(i, 0, &act);
t = act.sa_flags;
#else
t = signal(i, SIG_IGN);
signal(i, t);
#endif
PySignal_SignalHandlerArray[i].tripped = 0;
if (t == SIG_DFL)
PySignal_SignalHandlerArray[i].func =