From e550b5c085654f3310e378821d73bccce11fa172 Mon Sep 17 00:00:00 2001 From: Guo Ren Date: Thu, 13 Sep 2018 13:34:12 +0800 Subject: bugfix renameat2 wrong implement. Signed-off-by: Guo Ren --- libc/sysdeps/linux/common/rename.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libc/sysdeps/linux/common/rename.c b/libc/sysdeps/linux/common/rename.c index 30a4ed75f..613ae4e44 100644 --- a/libc/sysdeps/linux/common/rename.c +++ b/libc/sysdeps/linux/common/rename.c @@ -20,7 +20,9 @@ int rename(const char *oldpath, const char *newpath) # include 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) -- cgit v1.2.3