summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-08-04 04:06:30 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-08-04 04:06:30 +0000
commit9ddeeac95cc2728719c7399fdde362518bb522a0 (patch)
treed29ddcd441d66850812e030b60e6b2964f47d4c3 /pp_sys.c
parent4ec0190b08c455a89a958545841a796e66051771 (diff)
downloadperl-9ddeeac95cc2728719c7399fdde362518bb522a0.tar.gz
In the warnings call filehandles consistently so;
add "unopened" warning for stat(). p4raw-id: //depot/perl@6519
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/pp_sys.c b/pp_sys.c
index aa6d0bd536..9a264c8c44 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2505,8 +2505,12 @@ PP(pp_stat)
PL_laststatval = (GvIO(tmpgv) && IoIFP(GvIOp(tmpgv))
? PerlLIO_fstat(PerlIO_fileno(IoIFP(GvIOn(tmpgv))), &PL_statcache) : -1);
}
- if (PL_laststatval < 0)
+ if (PL_laststatval < 0) {
+ if (ckWARN(WARN_UNOPENED))
+ Perl_warner(aTHX_ WARN_UNOPENED, "%s() on unopened filehandle %s",
+ PL_op_desc[PL_op->op_type], GvENAME(tmpgv));
max = 0;
+ }
}
else {
SV* sv = POPs;
@@ -3059,8 +3063,8 @@ PP(pp_fttext)
else {
if (ckWARN(WARN_UNOPENED)) {
gv = cGVOP_gv;
- Perl_warner(aTHX_ WARN_UNOPENED, "Test on unopened file %s",
- GvENAME(gv));
+ Perl_warner(aTHX_ WARN_UNOPENED, "%s on unopened filehandle %s",
+ PL_op_desc[PL_op->op_type], GvENAME(gv));
}
SETERRNO(EBADF,RMS$_IFI);
RETPUSHUNDEF;