summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1999-07-09 01:21:13 -0400
committerGurusamy Sarathy <gsar@cpan.org>1999-07-17 18:10:44 +0000
commitd5a9bfb0fc8643b1208bad4f15e3c88ef46b4160 (patch)
treee0ca8ae480c779cf765b24fc29e445524f8fecf2 /doio.c
parent2f96c7027cf9ba783b07d2fd9195877ecc1a4b55 (diff)
downloadperl-d5a9bfb0fc8643b1208bad4f15e3c88ef46b4160.tar.gz
make system() return -1 and set $! if exec of child failed
Message-ID: <19990709052113.A6201@monk.mps.ohio-state.edu> Subject: [PATCH 5.005_57] system()==-1 and $! from failing fork/exec p4raw-id: //depot/perl@3679
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/doio.c b/doio.c
index 674bd7b1fb..b0c7a9e98c 100644
--- a/doio.c
+++ b/doio.c
@@ -1049,6 +1049,12 @@ Perl_my_lstat(pTHX)
bool
Perl_do_aexec(pTHX_ SV *really, register SV **mark, register SV **sp)
{
+ return do_aexec5(really, mark, sp, 0, 0);
+}
+
+bool
+do_aexec5(SV *really, register SV **mark, register SV **sp, int fd, int do_report)
+{
register char **a;
char *tmps;
STRLEN n_a;
@@ -1073,6 +1079,12 @@ Perl_do_aexec(pTHX_ SV *really, register SV **mark, register SV **sp)
if (ckWARN(WARN_EXEC))
Perl_warner(aTHX_ WARN_EXEC, "Can't exec \"%s\": %s",
PL_Argv[0], Strerror(errno));
+ if (do_report) {
+ int e = errno;
+
+ PerlLIO_write(fd, (void*)&e, sizeof(int));
+ PerlLIO_close(fd);
+ }
}
do_execfree();
return FALSE;