From: Gurusamy Sarathy Date: Mon, 8 May 2000 12:52:28 +0000 (+0000) Subject: fork() failure to create pseudo process sets errno=EAGAIN and returns X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=60fa28ff167ee89aee5425de954aa6183c50b55a;p=p5sagit%2Fp5-mst-13.2.git fork() failure to create pseudo process sets errno=EAGAIN and returns undef on windows (from Clinton Pierce ) p4raw-id: //depot/perl@6093 --- diff --git a/pp_sys.c b/pp_sys.c index 6bc9f8b..b661a88 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -3679,6 +3679,8 @@ PP(pp_fork) EXTEND(SP, 1); PERL_FLUSHALL_FOR_CHILD; childpid = PerlProc_fork(); + if (childpid == -1) + RETSETUNDEF; PUSHi(childpid); RETURN; # else diff --git a/sv.c b/sv.c index fb68efa..5517355 100644 --- a/sv.c +++ b/sv.c @@ -3467,7 +3467,7 @@ Perl_sv_insert(pTHX_ SV *bigstr, STRLEN offset, STRLEN len, char *little, STRLEN if (!bigstr) Perl_croak(aTHX_ "Can't modify non-existent substring"); SvPV_force(bigstr, curlen); - SvPOK_only_UTF8(bigstr); + (void)SvPOK_only_UTF8(bigstr); if (offset + len > curlen) { SvGROW(bigstr, offset+len+1); Zero(SvPVX(bigstr)+curlen, offset+len-curlen, char); diff --git a/win32/perlhost.h b/win32/perlhost.h index cac05b2..51e125b 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -1770,8 +1770,10 @@ PerlProcFork(struct IPerlProc* piPerl) (LPVOID)new_perl, 0, &id); # endif PERL_SET_THX(aTHXo); /* XXX perl_clone*() set TLS */ - if (!handle) - Perl_croak(aTHX_ "panic: pseudo fork() failed"); + if (!handle) { + errno = EAGAIN; + return -1; + } w32_pseudo_child_handles[w32_num_pseudo_children] = handle; w32_pseudo_child_pids[w32_num_pseudo_children] = id; ++w32_num_pseudo_children;