summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-14 23:34:26 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-05-14 23:34:26 +0000
commitee580363108be8ac33155650c6c18d2e5cf051f3 (patch)
tree624481ea9b43b14435199892029f54adfa629ab2 /perl.c
parent7b8d334a971230040a212bc5038097b3f600a094 (diff)
downloadperl-ee580363108be8ac33155650c6c18d2e5cf051f3.tar.gz
[win32] merge change#904 from maintbranch
p4raw-link: @904 on //depot/maint-5.004/perl: 0af7994b889ad0dfcacb011f16f9e3c77a9292b9 p4raw-id: //depot/win32/perl@975
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/perl.c b/perl.c
index 97b0c38238..2fdac458e2 100644
--- a/perl.c
+++ b/perl.c
@@ -1739,6 +1739,7 @@ Internet, point your browser at http://www.perl.com/, the Perl Home Page.\n\n");
/* compliments of Tom Christiansen */
/* unexec() can be found in the Gnu emacs distribution */
+/* Known to work with -DUNEXEC and using unexelf.c from GNU emacs-20.2 */
void
my_unexec(void)
@@ -1746,18 +1747,16 @@ my_unexec(void)
#ifdef UNEXEC
SV* prog;
SV* file;
- int status;
+ int status = 1;
extern int etext;
- prog = newSVpv(BIN_EXP);
+ prog = newSVpv(BIN_EXP, 0);
sv_catpv(prog, "/perl");
- file = newSVpv(origfilename);
+ file = newSVpv(origfilename, 0);
sv_catpv(file, ".perldump");
- status = unexec(SvPVX(file), SvPVX(prog), &etext, sbrk(0), 0);
- if (status)
- PerlIO_printf(PerlIO_stderr(), "unexec of %s into %s failed!\n",
- SvPVX(prog), SvPVX(file));
+ unexec(SvPVX(file), SvPVX(prog), &etext, sbrk(0), 0);
+ /* unexec prints msg to stderr in case of failure */
PerlProc_exit(status);
#else
# ifdef VMS