summaryrefslogtreecommitdiff
path: root/src/internal/slibtool_symlink_impl.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-04-15 06:22:36 +0000
committermidipix <writeonce@midipix.org>2021-04-15 08:03:32 +0000
commitb8d3bb8ec89cc703b939bd7097f931ce4ddc2200 (patch)
tree9e47196099e98780f3eccf1462536b3c2fab5f2e /src/internal/slibtool_symlink_impl.c
parentc81d169af088b6b90d850d7c0f5c5daae6cfc4ba (diff)
downloadslibtool-b8d3bb8ec89cc703b939bd7097f931ce4ddc2200.tar.bz2
slibtool-b8d3bb8ec89cc703b939bd7097f931ce4ddc2200.tar.xz
library: replace all uses of symlink() with symlinkat().
Diffstat (limited to 'src/internal/slibtool_symlink_impl.c')
-rw-r--r--src/internal/slibtool_symlink_impl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/internal/slibtool_symlink_impl.c b/src/internal/slibtool_symlink_impl.c
index cc09a32..8f1244d 100644
--- a/src/internal/slibtool_symlink_impl.c
+++ b/src/internal/slibtool_symlink_impl.c
@@ -9,6 +9,7 @@
#include <stdbool.h>
#include <unistd.h>
+#include "slibtool_driver_impl.h"
#include "slibtool_errinfo_impl.h"
#include "slibtool_symlink_impl.h"
#include "slibtool_readlink_impl.h"
@@ -24,6 +25,7 @@ int slbt_create_symlink(
const char * lnkname,
bool flawrapper)
{
+ int fdcwd;
char ** oargv;
const char * slash;
char * ln[5];
@@ -99,8 +101,11 @@ int slbt_create_symlink(
/* restore execution context */
ectx->argv = oargv;
+ /* fdcwd */
+ fdcwd = slbt_driver_fdcwd(dctx);
+
/* create symlink */
- if (symlink(atarget,tmplnk))
+ if (symlinkat(atarget,fdcwd,tmplnk))
return SLBT_SYSTEM_ERROR(dctx,tmplnk);
return rename(tmplnk,lnkname)