summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-03-22 11:59:44 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-03-22 11:59:44 +0000
commita00b5bd33cb12556305f4526d4870e67e2ca9517 (patch)
tree65c1599bac3840ee1c5d7c50de5268b31e9305f8 /pp_hot.c
parent4a7d1889681c73a99b9a39d8a3d3760367674002 (diff)
downloadperl-a00b5bd33cb12556305f4526d4870e67e2ca9517.tar.gz
If stdin, stdout or stderr get opened in unexpected read/write state
then warn at time of open not at time of use. p4raw-id: //depot/perlio@9295
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 711b560b8b..58874a87b9 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -346,7 +346,7 @@ PP(pp_add)
A side effect is that this also aggressively prefers integer maths over
fp maths for integer values.
- How to detect overflow?
+ How to detect overflow?
C 99 section 6.2.6.1 says
@@ -417,7 +417,7 @@ PP(pp_add)
UV result;
register UV buv;
bool buvok = SvUOK(TOPs);
-
+
if (buvok)
buv = SvUVX(TOPs);
else {
@@ -1459,10 +1459,9 @@ Perl_do_readline(pTHX)
}
else if (type == OP_GLOB)
SP--;
- else if (ckWARN(WARN_IO) /* stdout/stderr or other write fh */
- && (IoTYPE(io) == IoTYPE_WRONLY || fp == PerlIO_stdout()
- || fp == PerlIO_stderr()))
+ else if (ckWARN(WARN_IO) && IoTYPE(io) == IoTYPE_WRONLY) {
report_evil_fh(PL_last_in_gv, io, OP_phoney_OUTPUT_ONLY);
+ }
}
if (!fp) {
if (ckWARN2(WARN_GLOB, WARN_CLOSED)