summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2000-12-05 12:44:31 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-05 14:38:53 +0000
commit4c80c0b28d91ade6a9768a49b70f648aabec579b (patch)
treef5f9af3bd155cef5f27b65436f08069b62e51805 /pp_hot.c
parente11947490c2e87179a2e8ad633598bddc45928c9 (diff)
downloadperl-4c80c0b28d91ade6a9768a49b70f648aabec579b.tar.gz
shrink pp_hot fractionally
Message-ID: <20001205124431.E74518@plum.flirble.org> Use report_evil_fh(). p4raw-id: //depot/perl@7990
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/pp_hot.c b/pp_hot.c
index c12e986665..830d56ed03 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -415,21 +415,8 @@ PP(pp_print)
}
else if (!(fp = IoOFP(io))) {
if (ckWARN2(WARN_CLOSED, WARN_IO)) {
- if (IoIFP(io)) {
- /* integrate with report_evil_fh()? */
- char *name = NULL;
- if (isGV(gv)) {
- SV* sv = sv_newmortal();
- gv_efullname4(sv, gv, Nullch, FALSE);
- name = SvPV_nolen(sv);
- }
- if (name && *name)
- Perl_warner(aTHX_ WARN_IO,
- "Filehandle %s opened only for input", name);
- else
- Perl_warner(aTHX_ WARN_IO,
- "Filehandle opened only for input");
- }
+ if (IoIFP(io))
+ report_evil_fh(gv, io, OP_phoney_INPUT_ONLY);
else if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
}
@@ -1394,21 +1381,7 @@ Perl_do_readline(pTHX)
else if (ckWARN(WARN_IO) /* stdout/stderr or other write fh */
&& (IoTYPE(io) == IoTYPE_WRONLY || fp == PerlIO_stdout()
|| fp == PerlIO_stderr()))
- {
- /* integrate with report_evil_fh()? */
- char *name = NULL;
- if (isGV(PL_last_in_gv)) { /* can this ever fail? */
- SV* sv = sv_newmortal();
- gv_efullname4(sv, PL_last_in_gv, Nullch, FALSE);
- name = SvPV_nolen(sv);
- }
- if (name && *name)
- Perl_warner(aTHX_ WARN_IO,
- "Filehandle %s opened only for output", name);
- else
- Perl_warner(aTHX_ WARN_IO,
- "Filehandle opened only for output");
- }
+ report_evil_fh(PL_last_in_gv, io, OP_phoney_OUTPUT_ONLY);
}
if (!fp) {
if (ckWARN2(WARN_GLOB, WARN_CLOSED)