summaryrefslogtreecommitdiff
path: root/src/logic/slbt_exec_execute.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-04-13 16:46:12 +0000
committermidipix <writeonce@midipix.org>2021-04-15 08:03:31 +0000
commit7ae5c14d2b4cc2dce023dac9bdf6020962c7bcec (patch)
treed00fe17ad2871f6c8c0090e75653ad23bba963f4 /src/logic/slbt_exec_execute.c
parentc2a0f5a12171cbdb1915bad18cf0c48c790a1972 (diff)
downloadslibtool-7ae5c14d2b4cc2dce023dac9bdf6020962c7bcec.tar.bz2
slibtool-7ae5c14d2b4cc2dce023dac9bdf6020962c7bcec.tar.xz
library: replace all uses of stat() and lstat() with fstatat() counterparts.
Diffstat (limited to 'src/logic/slbt_exec_execute.c')
-rw-r--r--src/logic/slbt_exec_execute.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/logic/slbt_exec_execute.c b/src/logic/slbt_exec_execute.c
index bcf0913..91a1cb7 100644
--- a/src/logic/slbt_exec_execute.c
+++ b/src/logic/slbt_exec_execute.c
@@ -12,6 +12,7 @@
#include <slibtool/slibtool.h>
#include "slibtool_spawn_impl.h"
+#include "slibtool_driver_impl.h"
#include "slibtool_errinfo_impl.h"
int slbt_exec_execute(
@@ -19,6 +20,7 @@ int slbt_exec_execute(
struct slbt_exec_ctx * ectx)
{
int ret;
+ int fdcwd;
char * program;
char * script;
char * base;
@@ -66,8 +68,11 @@ int slbt_exec_execute(
mark = exeref + (base - script);
sprintf(mark,".libs/%s",base);
+ /* fdcwd */
+ fdcwd = slbt_driver_fdcwd(dctx);
+
/* swap vector */
- if (!(stat(script,&st)) && !(stat(wrapper,&st))) {
+ if (!fstatat(fdcwd,script,&st,0) && !fstatat(fdcwd,wrapper,&st,0)) {
ectx->cargv[0] = wrapper;
ectx->cargv[1] = program;
ectx->cargv[2] = exeref;