From f4e789af68ba25c01d6749424ed8f9cf655ece5e Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Tue, 27 Nov 2001 00:40:23 +0000 Subject: doio slightly smaller Message-ID: <20011127004023.S37621@plum.flirble.org> p4raw-id: //depot/perl@13290 --- doio.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'doio.c') diff --git a/doio.c b/doio.c index d005a4e72e..f5a26af092 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 */ -- cgit v1.2.1