public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] hurd: Fix renameat2 error
@ 2019-12-01 18:52 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2019-12-01 18:52 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d51ca7d6ad1ab41ee8c86680cc82a3b75cbb6fd3

commit d51ca7d6ad1ab41ee8c86680cc82a3b75cbb6fd3
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Dec 1 16:46:38 2019 +0000

    hurd: Fix renameat2 error
    
    renameat2 has to exclude RENAME_EXCHANGE | RENAME_NOREPLACE with EINVAL,
    as tested by stdio-common/tst-renameat2.

Diff:
---
 sysdeps/mach/hurd/renameat2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sysdeps/mach/hurd/renameat2.c b/sysdeps/mach/hurd/renameat2.c
index 7892e9c..9e8f39d 100644
--- a/sysdeps/mach/hurd/renameat2.c
+++ b/sysdeps/mach/hurd/renameat2.c
@@ -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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-01 18:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-01 18:52 [glibc] hurd: Fix renameat2 error Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).