diff options
author | Guido van Rossum <guido@python.org> | 1996-05-23 22:55:35 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-05-23 22:55:35 (GMT) |
commit | fb0df944cab9f43b14a976c8ff52533e833b36d7 (patch) | |
tree | d17711458bad467d68665886382f29ef9f15d429 /Modules/signalmodule.c | |
parent | 5555854e85db98e0608fe938823bddc33ff1cddf (diff) | |
download | cpython-fb0df944cab9f43b14a976c8ff52533e833b36d7.zip cpython-fb0df944cab9f43b14a976c8ff52533e833b36d7.tar.gz cpython-fb0df944cab9f43b14a976c8ff52533e833b36d7.tar.bz2 |
Use sigaction if possible
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r-- | Modules/signalmodule.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index fe79447..7bd1d06 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -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 = |