diff options
Diffstat (limited to 'extension')
-rw-r--r-- | extension/ChangeLog | 6 | ||||
-rw-r--r-- | extension/select.c | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/extension/ChangeLog b/extension/ChangeLog index 4bfc64d4..244940ec 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,9 @@ +2013-07-07 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * select.c (signal_handler): On platforms lacking sigaction, reset + the signal handler each time a signal is trapped to protect in case + the system resets it to default. + 2013-07-05 Andrew J. Schorr <aschorr@telemetry-investments.com> * select.c (signal_result): New function to set result string from diff --git a/extension/select.c b/extension/select.c index 3bcef166..072a562f 100644 --- a/extension/select.c +++ b/extension/select.c @@ -107,6 +107,15 @@ signal_handler(int signum) */ sigaddset(& caught.mask, signum); caught.flag = 1; +#ifndef HAVE_SIGACTION + /* + * On platforms without sigaction, we do not know how the legacy + * signal API will behave. There does not appear to be an autoconf + * test for whether the signal handler is reset to default each time + * a signal is trapped, so we do this to be safe. + */ + signal(signum, signal_handler); +#endif } static int |