summaryrefslogtreecommitdiff
path: root/tests/test-rename.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2010-12-25 17:17:36 +0100
committerBruno Haible <bruno@clisp.org>2010-12-25 17:17:36 +0100
commit3bde94be9dcb81f078ca8dae5b043852174899e9 (patch)
treed24e7dd281849f6836ebd49788c61ec502443b90 /tests/test-rename.h
parent09af249c375a176ea9db1765b8ad43f445390448 (diff)
downloadgnulib-3bde94be9dcb81f078ca8dae5b043852174899e9.tar.gz
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.
Diffstat (limited to 'tests/test-rename.h')
-rw-r--r--tests/test-rename.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/test-rename.h b/tests/test-rename.h
index 475ded06aa..922458562e 100644
--- a/tests/test-rename.h
+++ b/tests/test-rename.h
@@ -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