summaryrefslogtreecommitdiffhomepage
path: root/src/logic/slbt_exec_execute.c
diff options
context:
space:
mode:
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;