diff options
author | Tony Cook <tony@develop-help.com> | 2012-03-30 21:18:39 +1100 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-05-21 17:51:56 -0700 |
commit | 2b9f61bf2777091bfdddaf08e2df72e8de91cfa0 (patch) | |
tree | 8f716713370bfc0eee77fb5b3b19a28294118a4f /lib/File | |
parent | e0b1616f85224b731a379bf9969db48ca60be80a (diff) | |
download | perl-2b9f61bf2777091bfdddaf08e2df72e8de91cfa0.tar.gz |
[perl #111638] fix -p on File::stat objects
Diffstat (limited to 'lib/File')
-rw-r--r-- | lib/File/stat.pm | 6 | ||||
-rw-r--r-- | lib/File/stat.t | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/File/stat.pm b/lib/File/stat.pm index 34c883ba5e..90d53d78e8 100644 --- a/lib/File/stat.pm +++ b/lib/File/stat.pm @@ -37,10 +37,14 @@ BEGIN { my $val = eval { &{"Fcntl::S_I\U$_"} }; *{"_$_"} = defined $val ? sub { $_[0] & $val ? 1 : "" } : sub { "" }; } - for (qw(SOCK CHR BLK REG DIR FIFO LNK)) { + for (qw(SOCK CHR BLK REG DIR LNK)) { *{"S_IS$_"} = defined eval { &{"Fcntl::S_IF$_"} } ? \&{"Fcntl::S_IS$_"} : sub { "" }; } + # FIFO flag and macro don't quite follow the S_IF/S_IS pattern above + # RT #111638 + *{"S_ISFIFO"} = defined &Fcntl::S_IFIFO + ? \&Fcntl::S_ISFIFO : sub { "" }; } # from doio.c diff --git a/lib/File/stat.t b/lib/File/stat.t index 382f43e425..50981c6726 100644 --- a/lib/File/stat.t +++ b/lib/File/stat.t @@ -169,7 +169,6 @@ SKIP: my $pstat = File::stat::stat($rh); ok(!-p($stat), "-p should be false on a file"); - local $TODO = "RT #111638 -p overload broken"; ok(-p($pstat), "check -p detects a pipe"); } |