summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-12-28 07:55:45 +0000
committerNicholas Clark <nick@ccl4.org>2010-12-28 08:35:37 +0000
commita53904572d7a4d49d78b8fb0a3c739b451faad7e (patch)
tree4876ce6df10668c49c0e7ea612c1c6abbddc4ae2 /pp_sys.c
parent46d2cc544f36e7450798245748cda64959a6b884 (diff)
downloadperl-a53904572d7a4d49d78b8fb0a3c739b451faad7e.tar.gz
Extract the OP_phoney_* code from report_evil_fh() into report_wrongway_fh()
Previously Perl_report_evil_fh()'s body was just an if/else at the top level - a good sign that it is actually implementing two disjoint functions.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 0d382edac7..059fb03e11 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1451,7 +1451,7 @@ PP(pp_leavewrite)
if (!fp) {
if (ckWARN2(WARN_CLOSED,WARN_IO)) {
if (IoIFP(io))
- report_evil_fh(gv, io, OP_phoney_INPUT_ONLY);
+ report_wrongway_fh(gv, '<');
else if (ckWARN(WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
}
@@ -1519,7 +1519,7 @@ PP(pp_prtf)
else if (!(fp = IoOFP(io))) {
if (ckWARN2(WARN_CLOSED,WARN_IO)) {
if (IoIFP(io))
- report_evil_fh(gv, io, OP_phoney_INPUT_ONLY);
+ report_wrongway_fh(gv, '<');
else if (ckWARN(WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
}
@@ -1764,7 +1764,7 @@ PP(pp_sysread)
}
if (count < 0) {
if ((IoTYPE(io) == IoTYPE_WRONLY) && ckWARN(WARN_IO))
- report_evil_fh(gv, io, OP_phoney_OUTPUT_ONLY);
+ report_wrongway_fh(gv, '>');
goto say_undef;
}
SvCUR_set(read_target, count+(buffer - SvPVX_const(read_target)));
@@ -1866,7 +1866,7 @@ PP(pp_send)
retval = -1;
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED)) {
if (io && IoIFP(io))
- report_evil_fh(gv, io, OP_phoney_INPUT_ONLY);
+ report_wrongway_fh(gv, '<');
else
report_evil_fh(gv, io, PL_op->op_type);
}