summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2001-11-27 00:40:23 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-27 00:15:07 +0000
commitf4e789af68ba25c01d6749424ed8f9cf655ece5e (patch)
tree6589333d41735643812f77545186b054e371df5e /doio.c
parentbea4d472b6a588846418b9529f7f0665e27cd209 (diff)
downloadperl-f4e789af68ba25c01d6749424ed8f9cf655ece5e.tar.gz
doio slightly smaller
Message-ID: <20011127004023.S37621@plum.flirble.org> p4raw-id: //depot/perl@13290
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c9
1 files changed, 4 insertions, 5 deletions
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 */