summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2002-01-26 13:59:33 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2002-01-26 13:59:33 +0000
commit727405f80c5904bbe9e96e63570ee4516290a454 (patch)
tree8212698c6ae9002729944df18d6f188ae4e16b03 /mg.c
parent740874b26351ff352fbd12f44d98af902d6b0956 (diff)
downloadperl-727405f80c5904bbe9e96e63570ee4516290a454.tar.gz
If we get to sighandler by mistake (no perl handler set) then
warn() and exit() rather than die() - should never happen but if it does context needed to die is likely to be trashed as well. p4raw-id: //depot/perlio@14427
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/mg.c b/mg.c
index ba90587c22..30f91ee893 100644
--- a/mg.c
+++ b/mg.c
@@ -275,7 +275,7 @@ Perl_mg_clear(pTHX_ SV *sv)
for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
MGVTBL* vtbl = mg->mg_virtual;
/* omit GSKIP -- never set here */
-
+
if (vtbl && vtbl->svt_clear)
CALL_FPTR(vtbl->svt_clear)(aTHX_ sv, mg);
}
@@ -408,7 +408,7 @@ Perl_magic_regdatum_get(pTHX_ SV *sv, MAGIC *mg)
i = t;
else /* @- */
i = s;
-
+
if (i > 0 && PL_reg_match_utf8) {
char *b = rx->subbeg;
if (b)
@@ -548,11 +548,11 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
#ifdef MACOS_TRADITIONAL
{
char msg[256];
-
+
sv_setnv(sv,(double)gMacPerl_OSErr);
- sv_setpv(sv, gMacPerl_OSErr ? GetSysErrText(gMacPerl_OSErr, msg) : "");
+ sv_setpv(sv, gMacPerl_OSErr ? GetSysErrText(gMacPerl_OSErr, msg) : "");
}
-#else
+#else
#ifdef VMS
{
# include <descrip.h>
@@ -1521,7 +1521,7 @@ Perl_magic_setpos(pTHX_ SV *sv, MAGIC *mg)
sv_pos_u2b(lsv, &p, 0);
pos = p;
}
-
+
mg->mg_len = pos;
mg->mg_flags &= ~MGf_MINMATCH;
@@ -1945,7 +1945,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
else if (isWARN_on(sv, WARN_ALL) && !any_fatals) {
PL_compiling.cop_warnings = pWARN_ALL;
PL_dowarn |= G_WARN_ONCE ;
- }
+ }
else {
if (specialWARN(PL_compiling.cop_warnings))
PL_compiling.cop_warnings = newSVsv(sv) ;
@@ -2347,9 +2347,11 @@ Perl_sighandler(int sig)
if (PL_scopestack_ix < PL_scopestack_max - 3)
flags |= 16;
- if (!PL_psig_ptr[sig])
- Perl_die(aTHX_ "Signal SIG%s received, but no signal handler set.\n",
- PL_sig_name[sig]);
+ if (!PL_psig_ptr[sig]) {
+ Perl_warn(aTHX_ "Signal SIG%s received, but no signal handler set.\n",
+ PL_sig_name[sig]);
+ exit(sig);
+ }
/* Max number of items pushed there is 3*n or 4. We cannot fix
infinity, so we fix 4 (in fact 5): */
@@ -2493,4 +2495,3 @@ unwind_handler_stack(pTHX_ void *p)
}
-