rename, renameat: Avoid test failures at NFS mounted locations.
authorBruno Haible <bruno@clisp.org>
Sat, 25 Dec 2010 16:17:36 +0000 (17:17 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 25 Dec 2010 16:17:36 +0000 (17:17 +0100)
* tests/test-rename.h (assert_nonexistent): Remove the old directory,
so that subsequent mkdir calls succeed.

ChangeLog
tests/test-rename.h

index 98acbca4259ebd138e3768892a661c9eb06b2bf2..84c1e7ca1f38a33b1667e17104a6a33a79a7c864 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-12-25  Bruno Haible  <bruno@clisp.org>
+
+       rename, renameat: Avoid test failures at NFS mounted locations.
+       * tests/test-rename.h (assert_nonexistent): Remove the old directory,
+       so that subsequent mkdir calls succeed.
+
 2010-12-25  Bruno Haible  <bruno@clisp.org>
 
        iswblank: Fix C++ link error on Solaris 8.
index 475ded06aa768815129d0268c1d9a8f204182e18..922458562ec691da3f437faa6d649ab8566e84e9 100644 (file)
@@ -56,11 +56,16 @@ assert_nonexistent (const char *filename)
   if (stat (filename, &st) == -1)
     ASSERT (errno == ENOENT);
   else
-    /* But after renaming a directory over an empty directory on an NFS-mounted
-       file system, on Linux 2.6.18, for a period of 30 seconds the old
-       directory name is "present" according to stat() but "nonexistent"
-       according to dentry_exists().  */
-    ASSERT (!dentry_exists (filename));
+    {
+      /* But after renaming a directory over an empty directory on an NFS-
+         mounted file system, on Linux 2.6.18, for a period of 30 seconds the
+         old directory name is "present" according to stat() but "nonexistent"
+         according to dentry_exists().  */
+      ASSERT (!dentry_exists (filename));
+      /* Remove the old directory name, so that subsequent mkdir calls
+         succeed.  */
+      (void) rmdir (filename);
+    }
 }
 
 static int