summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorLeon Timmermans <fawaka@gmail.com>2011-02-24 21:34:40 +0000
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2011-02-24 21:34:40 +0000
commitb3dbdd48ca2da90bce7f16d545cca54c3dc58f35 (patch)
tree62f5d13eb693d0512df0dc40292af3cea7290ecc /mg.c
parent01c10dac6aeb4d749cce74f4d59961b729ad06af (diff)
downloadperl-b3dbdd48ca2da90bce7f16d545cca54c3dc58f35.tar.gz
Detect unsafe signals more reliably on BSD/Solaris
Previous versions of the Posix spec allowed the struct siginfo_t* parameter passed to the signal handler to be NULL in certain cases. More recent Posix specifications (SUSv3) have rescinded this: Now this parameter is required always to be non-NULL. However we use this parameter to differentiate between safe and unsafe signals, as in the former it will always be NULL and in the latter case it should have been non-NULL. This patch fixes this issue by also relying on the ucontext_t* parameter. This should reliably be non-NULL when using unsafe signals handlers. Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mg.c b/mg.c
index 6f8200164f..7b5fdf502b 100644
--- a/mg.c
+++ b/mg.c
@@ -3001,7 +3001,7 @@ Perl_whichsig(pTHX_ const char *sig)
Signal_t
#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-Perl_sighandler(int sig, siginfo_t *sip, void *uap PERL_UNUSED_DECL)
+Perl_sighandler(int sig, siginfo_t *sip, void *uap)
#else
Perl_sighandler(int sig)
#endif
@@ -3113,7 +3113,7 @@ Perl_sighandler(int sig)
*/
#ifdef HAS_SIGPROCMASK
#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
- if (sip)
+ if (sip || uap)
#endif
{
sigset_t set;