summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
authorGuo Ren <ren_guo@c-sky.com>2018-09-13 13:34:12 +0800
committerWaldemar Brodkorb <wbrodkorb@conet.de>2018-09-21 03:42:11 +0200
commite550b5c085654f3310e378821d73bccce11fa172 (patch)
tree822380b0d1465edc4189d09b1ccb4e2c5672eaba /libc/sysdeps
parentf664078e0fcd5988ef0acc124b1f52d2ce7be03c (diff)
bugfix renameat2 wrong implement.
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/linux/common/rename.c4
1 files changed, 3 insertions, 1 deletions
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 <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)