diff options
author | Tony Cook <tony@develop-help.com> | 2013-06-11 22:38:43 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2013-06-11 22:38:43 +1000 |
commit | d82e2a6d8f2cc6469125270842b1e69ea0d72831 (patch) | |
tree | 00b38e16103104904e9d474c3758a1cce354b22a /lib/File | |
parent | 386de64977e726b54f2312cf12fb0108a0993ec2 (diff) | |
download | perl-d82e2a6d8f2cc6469125270842b1e69ea0d72831.tar.gz |
prevent lib/File/stat.t from aborting at END on cygwin
cygwin appears to be unique in that it uses fast_abs_path() for
abs_path() and vaguely follows POSIX semantics on directory permissions.
Previously the tempdir created would be chmod() to 0600 (non-executable)
and fast_abs_path() would croak when it couldn't chdir into the
directory.
Diffstat (limited to 'lib/File')
-rw-r--r-- | lib/File/stat.t | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/File/stat.t b/lib/File/stat.t index b85ff95462..264ecd1919 100644 --- a/lib/File/stat.t +++ b/lib/File/stat.t @@ -112,6 +112,8 @@ foreach ([file => $file], my ($what, $pathname) = @$_; test_X_ops($pathname, "for $what $pathname"); + my $orig_mode = (CORE::stat $pathname)[2]; + my $mode = 01000; while ($mode) { $mode >>= 1; @@ -119,8 +121,8 @@ foreach ([file => $file], chmod $mode, $pathname or die "Can't chmod $mode_oct $pathname: $!"; test_X_ops($pathname, "for $what with mode=$mode_oct"); } - chmod 0600, $pathname - or die "Can't restore permissions on $pathname to 0600"; + chmod $orig_mode, $pathname + or die "Can't restore permissions on $pathname to ", sprintf("%#o", $orig_mode); } SKIP: { |