From: Nick Ing-Simmons Date: Fri, 20 Apr 2001 14:29:41 +0000 (+0100) Subject: Re: A new PerlIO coredump X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=376b794b180b45276f651a11960417bbf60ef2d6;p=p5sagit%2Fp5-mst-13.2.git Re: A new PerlIO coredump Message-Id: <200104201329.OAA16021@mikado.tiuk.ti.com> p4raw-id: //depot/perl@9763 --- diff --git a/doio.c b/doio.c index 631149d..fee610d 100644 --- a/doio.c +++ b/doio.c @@ -555,7 +555,10 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, if (savefd != fd) { Pid_t pid; SV *sv; - PerlLIO_dup2(fd, savefd); + if (PerlLIO_dup2(fd, savefd) < 0) { + (void)PerlIO_close(fp); + goto say_false; + } #ifdef VMS if (savefd != PerlIO_fileno(PerlIO_stdin())) { char newname[FILENAME_MAX+1];