summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-12-01 18:43:49 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-12-01 18:43:49 +0000
commitcc3604b14c0748189384ba69182e0ae2c73a4d88 (patch)
tree3c98d9b2228bd2dded53f28930f03155b48dddb9 /perl.c
parent3c3eec57473df2067943d3a2bb444a3e95a38412 (diff)
downloadperl-cc3604b14c0748189384ba69182e0ae2c73a4d88.tar.gz
avoid "Callback called exit" error on intentional exit()
p4raw-id: //depot/perl@4609
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/perl.c b/perl.c
index 0fb2f3508b..800e83b35f 100644
--- a/perl.c
+++ b/perl.c
@@ -1406,7 +1406,7 @@ Perl_call_sv(pTHX_ SV *sv, I32 flags)
/* my_exit() was called */
PL_curstash = PL_defstash;
FREETMPS;
- if (PL_statusvalue)
+ if (PL_statusvalue && !(PL_exit_flags & PERL_EXIT_EXPECTED))
Perl_croak(aTHX_ "Callback called exit");
my_exit_jump();
/* NOTREACHED */
@@ -1530,7 +1530,7 @@ Perl_eval_sv(pTHX_ SV *sv, I32 flags)
/* my_exit() was called */
PL_curstash = PL_defstash;
FREETMPS;
- if (PL_statusvalue)
+ if (PL_statusvalue && !(PL_exit_flags & PERL_EXIT_EXPECTED))
Perl_croak(aTHX_ "Callback called exit");
my_exit_jump();
/* NOTREACHED */
@@ -3169,7 +3169,7 @@ Perl_call_list(pTHX_ I32 oldscope, AV *paramList)
PL_curstash = PL_defstash;
PL_curcop = &PL_compiling;
CopLINE_set(PL_curcop, oldline);
- if (PL_statusvalue) {
+ if (PL_statusvalue && !(PL_exit_flags & PERL_EXIT_EXPECTED)) {
if (paramList == PL_beginav)
Perl_croak(aTHX_ "BEGIN failed--compilation aborted");
else