hurd: Fix renameat2 error

renameat2 has to exclude RENAME_EXCHANGE | RENAME_NOREPLACE with EINVAL,
as tested by stdio-common/tst-renameat2.
This commit is contained in:
Samuel Thibault 2019-12-01 16:46:38 +00:00
parent 563202976e
commit d51ca7d6ad

View File

@ -30,6 +30,8 @@ __renameat2 (int oldfd, const char *old, int newfd, const char *new,
const char *oldname, *newname;
int excl = 0;
if ((flags & (RENAME_EXCHANGE | RENAME_NOREPLACE)) == (RENAME_EXCHANGE | RENAME_NOREPLACE))
return __hurd_fail (EINVAL);
if (flags & (RENAME_EXCHANGE | RENAME_WHITEOUT))
return __hurd_fail (ENOSYS);
if (flags & RENAME_NOREPLACE)