summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-01-12 05:41:28 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-01-12 05:41:28 +0000
commit645f760415037835427326a63ea2418cd44ad456 (patch)
tree71c4b24c2565df95fd48d130423254d2ed6f65dd
parent075a4a2b17419f90b0888605cbb91ee4b236f645 (diff)
parente86d18fb728c811dd6c2cb46964683c4547de3e7 (diff)
downloadperl-645f760415037835427326a63ea2418cd44ad456.tar.gz
Integrate perlio:
[ 8408] Remove variables that were used in experiments. [ 8407] Catch die in %SIG handler and unblock the signal before re-dying. This make Linux work _without_ sigsetjmp(). Turn off sigsetjmp() to see what else it does. May need Configure probe for sigprocmask() if anything has sigaction() but not sigprocmask(). p4raw-link: @8408 on //depot/perlio: e86d18fb728c811dd6c2cb46964683c4547de3e7 p4raw-link: @8407 on //depot/perlio: 1b266415f383a85c93346bb15a7bdcac7f62eb77 p4raw-id: //depot/perl@8409
-rw-r--r--mg.c19
-rw-r--r--scope.h2
2 files changed, 19 insertions, 2 deletions
diff --git a/mg.c b/mg.c
index ca06b891fc..51ca9d637d 100644
--- a/mg.c
+++ b/mg.c
@@ -2223,9 +2223,26 @@ Perl_sighandler(int sig)
PUSHs(sv);
PUTBACK;
- call_sv((SV*)cv, G_DISCARD);
+ call_sv((SV*)cv, G_DISCARD|G_EVAL);
POPSTACK;
+ if (SvTRUE(ERRSV)) {
+#ifdef HAS_SIGACTION
+ /* Handler "died", for example to get out of a restart-able read().
+ * Before we re-do that on its behalf re-enable the signal which was
+ * blocked by the system when we entered.
+ */
+ sigset_t set;
+ sigemptyset(&set);
+ sigaddset(&set,sig);
+ sigprocmask(SIG_UNBLOCK, &set, NULL);
+#else
+ /* Not clear if this will work */
+ (void)rsignal(sig, SIG_IGN);
+ (void)rsignal(sig, PL_sighandlerp);
+#endif
+ Perl_die(aTHX_ Nullch);
+ }
cleanup:
if (flags & 1)
PL_savestack_ix -= 8; /* Unprotect save in progress. */
diff --git a/scope.h b/scope.h
index d45bd94243..0ceb6ba912 100644
--- a/scope.h
+++ b/scope.h
@@ -36,7 +36,7 @@
#define SAVEt_PADSV 35
#ifndef SCOPE_SAVES_SIGNAL_MASK
-#define SCOPE_SAVES_SIGNAL_MASK 1
+#define SCOPE_SAVES_SIGNAL_MASK 0
#endif
#define SSCHECK(need) if (PL_savestack_ix + need > PL_savestack_max) savestack_grow()