summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2008-02-11 00:05:14 +0000
committerCraig A. Berry <craigberry@mac.com>2008-02-11 00:05:14 +0000
commitdd568cb6980f05208b29e675f2bbb621acbef977 (patch)
treeb615b3f8efdd5c5ac2ab51590b24c1f6b806e56b
parent8798655dec8bb39ddfc6da720c750a733c8d3662 (diff)
downloadperl-dd568cb6980f05208b29e675f2bbb621acbef977.tar.gz
Make fs.t compare the permissions of a link with those
of the linked file rather than guessing at system defaults. p4raw-id: //depot/perl@33274
-rwxr-xr-xt/io/fs.t8
1 files changed, 6 insertions, 2 deletions
diff --git a/t/io/fs.t b/t/io/fs.t
index b897647106..5113a5f0fd 100755
--- a/t/io/fs.t
+++ b/t/io/fs.t
@@ -87,7 +87,7 @@ open(FH,'>a') || die "Can't create a";
close(FH);
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
- $blksize,$blocks);
+ $blksize,$blocks,$a_mode);
SKIP: {
skip("no link", 4) unless $has_link;
@@ -95,6 +95,8 @@ SKIP: {
ok(link('a','b'), "link a b");
ok(link('b','c'), "link b c");
+ $a_mode = (stat('a'))[2];
+
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('c');
@@ -111,7 +113,9 @@ SKIP: {
# if ($^O eq 'cygwin') { # new files on cygwin get rwx instead of rw-
# is($mode & 0777, 0777, "mode of triply-linked file");
# } else {
- is($mode & 0777, 0666, "mode of triply-linked file");
+ is(sprintf("0%o", $mode & 0777),
+ sprintf("0%o", $a_mode & 0777),
+ "mode of triply-linked file");
# }
}
}