From: Nicholas Clark Date: Tue, 27 Nov 2001 00:40:23 +0000 (+0000) Subject: doio slightly smaller X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f4e789af68ba25c01d6749424ed8f9cf655ece5e;p=p5sagit%2Fp5-mst-13.2.git doio slightly smaller Message-ID: <20011127004023.S37621@plum.flirble.org> p4raw-id: //depot/perl@13290 --- diff --git a/doio.c b/doio.c index d005a4e..f5a26af 100644 --- a/doio.c +++ b/doio.c @@ -307,8 +307,7 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, #endif goto say_false; } - if (IoIFP(thatio)) { - that_fp = IoIFP(thatio); + if ((that_fp = IoIFP(thatio))) { /* Flush stdio buffer before dup. --mjd * Unfortunately SEEK_CURing 0 seems to * be optimized away on most platforms; @@ -329,10 +328,10 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, fd = PerlIO_fileno(that_fp); /* When dup()ing STDIN, STDOUT or STDERR * explicitly set appropriate access mode */ - if (IoIFP(thatio) == PerlIO_stdout() - || IoIFP(thatio) == PerlIO_stderr()) + if (that_fp == PerlIO_stdout() + || that_fp == PerlIO_stderr()) IoTYPE(io) = IoTYPE_WRONLY; - else if (IoIFP(thatio) == PerlIO_stdin()) + else if (that_fp == PerlIO_stdin()) IoTYPE(io) = IoTYPE_RDONLY; /* When dup()ing a socket, say result is * one as well */