summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2019-08-07 10:45:52 +1000
committerTony Cook <tony@develop-help.com>2019-08-07 10:45:52 +1000
commit625e8b0bffed3334db9b3897f8713d570fd5385c (patch)
treec7a9cf67a4f2ab6e6d4dcb0829e69db340af1185 /perl.c
parent1d48e83dd8863e78e8422ed502d9b2f3199193f5 (diff)
downloadperl-625e8b0bffed3334db9b3897f8713d570fd5385c.tar.gz
Revert "Revert "postpone perl_parse() exit(0) bugfix""
This reverts commit 2773b4f50f991900e38d33daace2b9c6a0902c6a. I haven't made much progress in resolving the problems this produces downstream, so rather than leaving it broken, I'll revert it until they can be solved.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/perl.c b/perl.c
index a84a0a955b..e642f2e76d 100644
--- a/perl.c
+++ b/perl.c
@@ -1624,13 +1624,16 @@ For historical reasons, the non-zero return value also attempts to
be a suitable value to pass to the C library function C<exit> (or to
return from C<main>), to serve as an exit code indicating the nature
of the way initialisation terminated. However, this isn't portable,
-due to differing exit code conventions. An attempt is made to return
-an exit code of the type required by the host operating system, but
-because it is constrained to be non-zero, it is not necessarily possible
-to indicate every type of exit. It is only reliable on Unix, where a
-zero exit code can be augmented with a set bit that will be ignored.
-In any case, this function is not the correct place to acquire an exit
-code: one should get that from L</perl_destruct>.
+due to differing exit code conventions. A historical bug is preserved
+for the time being: if the Perl built-in C<exit> is called during this
+function's execution, with a type of exit entailing a zero exit code
+under the host operating system's conventions, then this function
+returns zero rather than a non-zero value. This bug, [perl #2754],
+leads to C<perl_run> being called (and therefore C<INIT> blocks and the
+main program running) despite a call to C<exit>. It has been preserved
+because a popular module-installing module has come to rely on it and
+needs time to be fixed. This issue is [perl #132577], and the original
+bug is due to be fixed in Perl 5.30.
=cut
*/
@@ -1839,7 +1842,15 @@ perl_parse(pTHXx_ XSINIT_t xsinit, int argc, char **argv, char **env)
call_list(oldscope, PL_checkav);
}
ret = STATUS_EXIT;
- if (ret == 0) ret = 0x100;
+ if (ret == 0) {
+ /*
+ * At this point we should do
+ * ret = 0x100;
+ * to avoid [perl #2754], but that bugfix has been postponed
+ * because of the Module::Install breakage it causes
+ * [perl #132577].
+ */
+ }
break;
case 3:
PerlIO_printf(Perl_error_log, "panic: top_env\n");