summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-12-28 08:56:36 +0000
committerNicholas Clark <nick@ccl4.org>2010-12-28 10:03:38 +0000
commit65820a288a7a8e6320b960e1ffcb1dc9577b9650 (patch)
treea54299536df38c3d0ae89cf1a257cc09e6efb923 /util.c
parenta53904572d7a4d49d78b8fb0a3c739b451faad7e (diff)
downloadperl-65820a288a7a8e6320b960e1ffcb1dc9577b9650.tar.gz
The io argument to report_evil_fh() is always GvIO(gv), so need not be passed.
Diffstat (limited to 'util.c')
-rw-r--r--util.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/util.c b/util.c
index ff1e756852..54e658b1d9 100644
--- a/util.c
+++ b/util.c
@@ -3882,12 +3882,13 @@ Perl_report_wrongway_fh(pTHX_ const GV *gv, char have)
}
void
-Perl_report_evil_fh(pTHX_ const GV *gv, const IO *io, I32 op)
+Perl_report_evil_fh(pTHX_ const GV *gv, I32 op)
{
+ const IO *io = gv ? GvIO(gv) : NULL;
const char *vile;
I32 warn_type;
- if (gv && io && IoTYPE(io) == IoTYPE_CLOSED) {
+ if (io && IoTYPE(io) == IoTYPE_CLOSED) {
vile = "closed";
warn_type = WARN_CLOSED;
}
@@ -3909,7 +3910,7 @@ Perl_report_evil_fh(pTHX_ const GV *gv, const IO *io, I32 op)
PL_op_desc[op]);
const char * const type =
(const char *)
- (OP_IS_SOCKET(op) || (gv && io && IoTYPE(io) == IoTYPE_SOCKET)
+ (OP_IS_SOCKET(op) || (io && IoTYPE(io) == IoTYPE_SOCKET)
? "socket" : "filehandle");
if (name && *name) {
Perl_warner(aTHX_ packWARN(warn_type),
@@ -3924,7 +3925,7 @@ Perl_report_evil_fh(pTHX_ const GV *gv, const IO *io, I32 op)
else {
Perl_warner(aTHX_ packWARN(warn_type),
"%s%s on %s %s", func, pars, vile, type);
- if (gv && io && IoDIRP(io) && !(IoFLAGS(io) & IOf_FAKE_DIRP))
+ if (io && IoDIRP(io) && !(IoFLAGS(io) & IOf_FAKE_DIRP))
Perl_warner(
aTHX_ packWARN(warn_type),
"\t(Are you trying to call %s%s on dirhandle?)\n",