This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Detect unsafe signals more reliably on BSD/Solaris
authorLeon Timmermans <fawaka@gmail.com>
Thu, 24 Feb 2011 21:34:40 +0000 (21:34 +0000)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Thu, 24 Feb 2011 21:34:40 +0000 (21:34 +0000)
commitb3dbdd48ca2da90bce7f16d545cca54c3dc58f35
tree62f5d13eb693d0512df0dc40292af3cea7290ecc
parent01c10dac6aeb4d749cce74f4d59961b729ad06af
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>
mg.c
t/op/sigdispatch.t