On OSF/1 5.1, I get these test failures: test-rename.h:342: assertion failed sh: 366977 Abort - core dumped FAIL: test-rename
test-rename.h:342: assertion failed sh: 366978 Abort - core dumped FAIL: test-renameat The reason are different errno values. The following patch fixes it for me. OK to commit, or do you want to change the rename replacement to produce one of the expected errno values? For info, config.status contains this: S["REPLACE_RENAME"]="0" S["REPLACE_RENAMEAT"]="0" S["HAVE_RENAMEAT"]="0" So, it's using the rename() function from the system and the renameat() from lib/renameat.c. Bruno 2010-12-22 Bruno Haible <br...@clisp.org> rename, renameat: Avoid test failures on OSF/1 5.1. * tests/test-rename.h (test_rename): Allow EEXIST and ENOTDIR as alternative error codes. * tests/test-renameat.c (main): Likewise. --- tests/test-rename.h.orig Wed Dec 22 16:25:12 2010 +++ tests/test-rename.h Wed Dec 22 16:22:19 2010 @@ -339,7 +339,7 @@ { errno = 0; ASSERT (func (BASE "dir2/.", BASE "dir") == -1); - ASSERT (errno == EINVAL || errno == EBUSY); + ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST); } ASSERT (rmdir (BASE "dir") == 0); /* Files present here: @@ -366,7 +366,7 @@ { errno = 0; ASSERT (func (BASE "dir2/.//", BASE "dir") == -1); - ASSERT (errno == EINVAL || errno == EBUSY); + ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST); } ASSERT (rmdir (BASE "dir2") == 0); /* Files present here: @@ -914,7 +914,7 @@ if (result) /* GNU/Linux rejects attempts to use link2/. */ { ASSERT (result == -1); - ASSERT (errno == ENOTDIR); + ASSERT (errno == ENOTDIR || errno == EISDIR); } memset (&st, 0, sizeof st); ASSERT (lstat (BASE "dir", &st) == 0); --- tests/test-renameat.c.orig Wed Dec 22 16:25:12 2010 +++ tests/test-renameat.c Wed Dec 22 16:23:12 2010 @@ -133,7 +133,7 @@ || errno == ENOTEMPTY); errno = 0; ASSERT (renameat (dfd, BASE "sub2/.", dfd, BASE "sub1") == -1); - ASSERT (errno == EINVAL || errno == EBUSY); + ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST); errno = 0; ASSERT (renameat (dfd, BASE "17", dfd, BASE "sub1") == -1); ASSERT (errno == EISDIR);