summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorSlaven Rezic <srezic@iconmobile.com>2009-01-08 13:05:58 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-01-19 12:25:19 +0100
commitb3647a361211e9f2a6bf737a259cceab1db864a9 (patch)
treef8e441b5248b5a2bd2e76c625175e8c57154897d /util.c
parent4c6e94b1e729ad5095947e2c098f9651932479d7 (diff)
downloadperl-b3647a361211e9f2a6bf737a259cceab1db864a9.tar.gz
about warnings if forks fail in Perl_my_popen
Diffstat (limited to 'util.c')
-rw-r--r--util.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/util.c b/util.c
index c4fa794219..86c06f5283 100644
--- a/util.c
+++ b/util.c
@@ -2288,6 +2288,8 @@ Perl_my_popen_list(pTHX_ const char *mode, int n, SV **args)
}
return NULL;
}
+ if (ckWARN(WARN_PIPE))
+ Perl_warner(aTHX_ packWARN(WARN_PIPE), "Can't fork, trying again in 5 seconds");
sleep(5);
}
if (pid == 0) {
@@ -2433,9 +2435,11 @@ Perl_my_popen(pTHX_ const char *cmd, const char *mode)
PerlLIO_close(pp[1]);
}
if (!doexec)
- Perl_croak(aTHX_ "Can't fork");
+ Perl_croak(aTHX_ "Can't fork: %s", Strerror(errno));
return NULL;
}
+ if (ckWARN(WARN_PIPE))
+ Perl_warner(aTHX_ packWARN(WARN_PIPE), "Can't fork, trying again in 5 seconds");
sleep(5);
}
if (pid == 0) {