summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-04-15 06:25:47 +0000
committermidipix <writeonce@midipix.org>2021-04-15 08:03:32 +0000
commitd586fc76aa37919351355792e7ef829d30cf3922 (patch)
tree26ef46b43d6832dfbffdb3f3739491f5ebaacdb8 /src
parentb8d3bb8ec89cc703b939bd7097f931ce4ddc2200 (diff)
downloadslibtool-d586fc76aa37919351355792e7ef829d30cf3922.tar.bz2
slibtool-d586fc76aa37919351355792e7ef829d30cf3922.tar.xz
library: replace all uses of rename() with renameat().
Diffstat (limited to 'src')
-rw-r--r--src/internal/slibtool_symlink_impl.c2
-rw-r--r--src/logic/slbt_exec_link.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/internal/slibtool_symlink_impl.c b/src/internal/slibtool_symlink_impl.c
index 8f1244d..ca7f6cd 100644
--- a/src/internal/slibtool_symlink_impl.c
+++ b/src/internal/slibtool_symlink_impl.c
@@ -108,7 +108,7 @@ int slbt_create_symlink(
if (symlinkat(atarget,fdcwd,tmplnk))
return SLBT_SYSTEM_ERROR(dctx,tmplnk);
- return rename(tmplnk,lnkname)
+ return renameat(fdcwd,tmplnk,fdcwd,lnkname)
? SLBT_SYSTEM_ERROR(dctx,lnkname)
: 0;
}
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index 94f1f19..d83935c 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -1766,7 +1766,7 @@ static int slbt_exec_link_create_executable(
&depsmeta,
SLBT_SYSTEM_ERROR(dctx,wrapper));
- if (rename(wrapper,dctx->cctx->output))
+ if (renameat(fdcwd,wrapper,fdcwd,dctx->cctx->output))
return slbt_exec_link_exit(
&depsmeta,
SLBT_SYSTEM_ERROR(dctx,dctx->cctx->output));