summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2019-11-11 14:03:41 +0000
committerDavid Mitchell <davem@iabyn.com>2019-11-18 09:34:40 +0000
commitddb513d51f5efcde057dad7932a56643647947e1 (patch)
tree22422f506519f87ae5e441455b75f96aa5ff950f /mg.c
parent8a5e470b690b1c90c7332e613ada153af5547505 (diff)
downloadperl-ddb513d51f5efcde057dad7932a56643647947e1.tar.gz
fix unsafe signals under exceptions
The preceding commit flagged up an existing bug, but kept old the buggy behaviour. This commit fixes the bug. I haven't added a test, since it seems that the test suite doesn't try with unsafe signals. But this code: $SIG{USR1} = sub { $gotit++, die }; eval { kill SIGUSR1, $$ } for 1..2; print "gotit=$gotit\n"; when run before erroneously gave 1, but now correctly gives 2. Basically the code that restores the signal mask after a sig handler dies, should do it only in a direct (unsafe) signal handler: the deferred (safe) signal handler will have already done it. The bug was that the inbuilt perl unsafe signal handler was being incorrectly treated as safe. The code path via POSIX (and for which a test was added with v5.13.9-531-gc22d665b55) *was* ok.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index a934ea7e2f..7b96dce188 100644
--- a/mg.c
+++ b/mg.c
@@ -1539,7 +1539,7 @@ Perl_csighandler(int sig)
* rather than via Perl_sighandler, passing the extra
* 'safe = false' arg
*/
- Perl_perly_sighandler(sig, NULL, NULL, 1 /* XXX tmp safe */);
+ Perl_perly_sighandler(sig, NULL, NULL, 0 /* unsafe */);
else
#ifdef PERL_USE_3ARG_SIGHANDLER
(*PL_sighandlerp)(sig, NULL, NULL);