From: Bruno Haible Date: Sat, 25 Dec 2010 16:17:36 +0000 (+0100) Subject: rename, renameat: Avoid test failures at NFS mounted locations. X-Git-Tag: v0.1~3459 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=3bde94be9dcb81f078ca8dae5b043852174899e9;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 98acbca42..84c1e7ca1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-12-25 Bruno Haible + 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 + iswblank: Fix C++ link error on Solaris 8. * lib/wctype.in.h (iswblank): Declare using _GL_FUNCDECL_RPL or _GL_FUNCDECL_SYS. diff --git a/tests/test-rename.h b/tests/test-rename.h index 475ded06a..922458562 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