summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorArtur Bergman <sky@nanisky.com>2001-08-17 04:18:11 +0000
committerArtur Bergman <sky@nanisky.com>2001-08-17 04:18:11 +0000
commit31d77e546f9eed28b984703264e32f2200f7aa8b (patch)
treebfa3d2b80ddab3b2f4e6292b4ee50a09666b5907 /perl.c
parent453946077c880e7dc58ef4fa7340353d6caec987 (diff)
downloadperl-31d77e546f9eed28b984703264e32f2200f7aa8b.tar.gz
Adds PERL_EXIT_DESTRUCT_END to PL_exit_flags which if set moves END block running to perl_destruct, changes prototype of perl_destruct to return exitstatus.
p4raw-id: //depot/perl@11702
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/perl.c b/perl.c
index dc6feded70..4bda944530 100644
--- a/perl.c
+++ b/perl.c
@@ -301,7 +301,7 @@ Shuts down a Perl interpreter. See L<perlembed>.
=cut
*/
-void
+int
perl_destruct(pTHXx)
{
int destruct_level; /* 0=none, 1=full, 2=full with checks */
@@ -397,7 +397,8 @@ perl_destruct(pTHXx)
}
#endif
- {
+
+ if(PL_exit_flags & PERL_EXIT_DESTRUCT_END) {
dJMPENV;
int x = 0;
@@ -456,7 +457,7 @@ perl_destruct(pTHXx)
DEBUG_P(debprofdump());
/* The exit() function will do everything that needs doing. */
- return;
+ return STATUS_NATIVE_EXPORT;;
}
/* jettison our possibly duplicated environment */
@@ -854,6 +855,7 @@ perl_destruct(pTHXx)
Safefree(PL_mess_sv);
PL_mess_sv = Nullsv;
}
+ return STATUS_NATIVE_EXPORT;
}
/*
@@ -1513,6 +1515,9 @@ perl_run(pTHXx)
LEAVE;
FREETMPS;
PL_curstash = PL_defstash;
+ if (!(PL_exit_flags & PERL_EXIT_DESTRUCT_END) &&
+ PL_endav && !PL_minus_c)
+ call_list(oldscope, PL_endav);
#ifdef MYMALLOC
if (PerlEnv_getenv("PERL_DEBUG_MSTATS"))
dump_mstats("after execution: ");