summaryrefslogtreecommitdiff
path: root/lib/File
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2019-11-26 09:48:58 +1100
committerKarl Williamson <khw@cpan.org>2019-11-26 10:37:25 -0800
commit526904c795caa76480cb49ae82254581cfc55501 (patch)
tree7e832537f6cffb7b6945e6742a532f72adbf03a4 /lib/File
parentd2e1c8518b05c6465fa975edc38f4c1d61663f57 (diff)
downloadperl-526904c795caa76480cb49ae82254581cfc55501.tar.gz
more closely match File::stat's -X behaviour to built-in on cygwin
Diffstat (limited to 'lib/File')
-rw-r--r--lib/File/stat.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/File/stat.pm b/lib/File/stat.pm
index 578c3118c8..863092c93d 100644
--- a/lib/File/stat.pm
+++ b/lib/File/stat.pm
@@ -5,12 +5,13 @@ use strict;
use warnings;
use warnings::register;
use Carp;
+use constant _IS_CYGWIN => $^O eq "cygwin";
BEGIN { *warnif = \&warnings::warnif }
our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS);
-our $VERSION = '1.08';
+our $VERSION = '1.09';
our @fields;
our ( $st_dev, $st_ino, $st_mode,
@@ -98,7 +99,7 @@ else {
# This code basically assumes that the rwx bits of the mode are
# the 0777 bits, but so does Perl_cando.
- if ($uid == 0 && $^O ne "VMS") {
+ if (_IS_CYGWIN ? _ingroup(544, $eff) : ($uid == 0 && $^O ne "VMS")) {
# If we're root on unix
# not testing for executable status => all file tests are true
return 1 if !($mode & 0111);