diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-04 04:06:30 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-04 04:06:30 +0000 |
commit | 9ddeeac95cc2728719c7399fdde362518bb522a0 (patch) | |
tree | d29ddcd441d66850812e030b60e6b2964f47d4c3 /pp_sys.c | |
parent | 4ec0190b08c455a89a958545841a796e66051771 (diff) | |
download | perl-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.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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; |