Browse Source

bugfix renameat2 wrong implement.

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Guo Ren 5 years ago
parent
commit
e550b5c085
1 changed files with 3 additions and 1 deletions
  1. 3 1
      libc/sysdeps/linux/common/rename.c

+ 3 - 1
libc/sysdeps/linux/common/rename.c

@@ -20,7 +20,9 @@ int rename(const char *oldpath, const char *newpath)
 # include <fcntl.h>
 int rename(const char *oldpath, const char *newpath)
 {
-	_syscall2(int, renameat2, const char *, oldpath, const char *, newpath)
+	_syscall5(int, renameat2, int, olddfd, const char *, oldpath,
+		  int, newdfd, const char *, newpath, int, flags)
+	return renameat2(AT_FDCWD, oldpath, AT_FDCWD, newpath, 0);
 }
 #else
 _syscall2(int, rename, const char *, oldpath, const char *, newpath)