about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/renameat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/renameat.c')
-rw-r--r--sysdeps/mach/hurd/renameat.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/sysdeps/mach/hurd/renameat.c b/sysdeps/mach/hurd/renameat.c
index 9aa231091c..a05f550a57 100644
--- a/sysdeps/mach/hurd/renameat.c
+++ b/sysdeps/mach/hurd/renameat.c
@@ -24,26 +24,7 @@
 int
 __renameat (int oldfd, const char *old, int newfd, const char *new)
 {
-  error_t err;
-  file_t olddir, newdir;
-  const char *oldname, *newname;
-
-  olddir = __directory_name_split_at (oldfd, old, (char **) &oldname);
-  if (olddir == MACH_PORT_NULL)
-    return -1;
-  newdir = __directory_name_split_at (newfd, new, (char **) &newname);
-  if (newdir == MACH_PORT_NULL)
-    {
-       __mach_port_deallocate (__mach_task_self (), olddir);
-      return -1;
-    }
-
-  err = __dir_rename (olddir, oldname, newdir, newname, 0);
-  __mach_port_deallocate (__mach_task_self (), olddir);
-  __mach_port_deallocate (__mach_task_self (), newdir);
-  if (err)
-    return __hurd_fail (err);
-  return 0;
+  return __renameat2 (oldfd, old, newfd, new, 0);
 }
 libc_hidden_def (__renameat)
 weak_alias (__renameat, renameat)