summaryrefslogtreecommitdiffhomepage
path: root/src/helper
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/helper
parentc81d169af088b6b90d850d7c0f5c5daae6cfc4ba (diff)
downloadslibtool-b8d3bb8ec89cc703b939bd7097f931ce4ddc2200.tar.bz2
slibtool-b8d3bb8ec89cc703b939bd7097f931ce4ddc2200.tar.xz
library: replace all uses of symlink() with symlinkat().
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/slbt_archive_import.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/helper/slbt_archive_import.c b/src/helper/slbt_archive_import.c
index b3b1cec..444c48d 100644
--- a/src/helper/slbt_archive_import.c
+++ b/src/helper/slbt_archive_import.c
@@ -4,6 +4,7 @@
/* Released under the Standard MIT License; see COPYING.SLIBTOOL. */
/*******************************************************************/
+#include <fcntl.h>
#include <stdio.h>
#include <limits.h>
#include <unistd.h>
@@ -21,6 +22,7 @@
#include "slibtool_errinfo_impl.h"
static char * slbt_mri_argument(
+ int fdat,
char * arg,
char * buf)
{
@@ -50,7 +52,7 @@ static char * slbt_mri_argument(
if (!(tmpnam(buf)))
return 0;
- if (!(symlink(target,buf)))
+ if (!(symlinkat(target,fdat,buf)))
lnk = buf;
}
@@ -127,8 +129,8 @@ int slbt_archive_import(
ectx->pid = pid;
- dst = slbt_mri_argument(dstarchive,mridst);
- src = slbt_mri_argument(srcarchive,mrisrc);
+ dst = slbt_mri_argument(fdcwd,dstarchive,mridst);
+ src = slbt_mri_argument(fdcwd,srcarchive,mrisrc);
fmt = "OPEN %s\n"
"ADDLIB %s\n"
"SAVE\n"