diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-01-13 23:50:15 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-01-13 23:50:15 -0800 |
commit | 21a64c3ee03cc1a361f10224a63c36ef3523d3d8 (patch) | |
tree | c3c06a125430d5a4957fdf7f29bf42d64e53fd67 /pp_sys.c | |
parent | 81e9306fe8a12b70bdbd5c6cb413cb13cee4df4d (diff) | |
download | perl-21a64c3ee03cc1a361f10224a63c36ef3523d3d8.tar.gz |
Make -T HANDLE and -B HANDLE always set last stat type
-T and -B on handles always set PL_laststatval (which indicates the
success of the previous stat). But they don’t set the last stat type
(PL_laststype) for closed filehandles. Those two should always go
together. stat and -r, -w etc., always set PL_laststype for a closed
or missing filehandle.
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3332,11 +3332,11 @@ PP(pp_fttext) io = GvIO(PL_statgv); } PL_laststatval = -1; + PL_laststype = OP_STAT; if (io && IoIFP(io)) { if (! PerlIO_has_base(IoIFP(io))) DIE(aTHX_ "-T and -B not implemented on filehandles"); PL_laststatval = PerlLIO_fstat(PerlIO_fileno(IoIFP(io)), &PL_statcache); - PL_laststype = OP_STAT; if (PL_laststatval < 0) RETPUSHUNDEF; if (S_ISDIR(PL_statcache.st_mode)) { /* handle NFS glitch */ |