develooper Front page | perl.perl5.porters | Postings from January 2001

PATCH 5.6.1 & blead 8327 -- workaround for t/io/fs.t

From:
Raphael Manfredi
Date:
January 5, 2001 04:47
Subject:
PATCH 5.6.1 & blead 8327 -- workaround for t/io/fs.t
Message ID:
13693.978698811@nice.ram.loc
Here's my tested workaround for t/io/fs.t when testing via NFS.

Apparently, the glibc2.2 + linux 2.4.0 + NFS combination prevent
accurate reading of the "atime".  I lack the time to futher characterize
the problem.  Note that the "touch" command works, even via NFS.

Anyway, here it is.  It should apply more or less on bleadperl (not tested)

Raphael

--- perl-5.6.1-TRIAL1/t/io/fs.t.orig	Fri Jan  5 12:42:37 2001
+++ perl-5.6.1-TRIAL1/t/io/fs.t	Fri Jan  5 13:41:25 2001
@@ -115,7 +115,15 @@
     {print "ok 18 # skipped: granularity of the filetime\n";}
 elsif ($atime == 500000000 && $mtime == 500000000 + $delta)
     {print "ok 18\n";}
-else
+elsif ($^O =~ /\blinux\b/i) {
+    # Maybe stat() cannot get the correct atime, as happens via NFS on linux?
+    $foo = (utime 400000000,500000000 + 2*$delta,'b');
+    my ($new_atime, $new_mtime) = (stat('b'))[8,9];
+    if ($new_atime == $atime && $new_mtime - $mtime == $delta)
+	{print "ok 18 # accounted for possible NFS/glibc2.2 bug on linux\n";}
+    else
+	{print "not ok 18 $atime/$new_atime $mtime/$new_mtime\n";}
+} else
     {print "not ok 18 $atime $mtime\n";}
 
 if ((unlink 'b') == 1) {print "ok 19\n";} else {print "not ok 19\n";}



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About