From: Craig A. Berry Date: Mon, 11 Feb 2008 00:05:14 +0000 (+0000) Subject: Make fs.t compare the permissions of a link with those X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dd568cb6980f05208b29e675f2bbb621acbef977;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/t/io/fs.t b/t/io/fs.t index b897647..5113a5f 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"); # } } }