summaryrefslogtreecommitdiff
path: root/src/logic/slbt_exec_ctx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/logic/slbt_exec_ctx.c')
-rw-r--r--src/logic/slbt_exec_ctx.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c
index bc89ca4..230dd7f 100644
--- a/src/logic/slbt_exec_ctx.c
+++ b/src/logic/slbt_exec_ctx.c
@@ -10,21 +10,11 @@
#include <string.h>
#include <slibtool/slibtool.h>
+#include "slibtool_driver_impl.h"
#include "slibtool_errinfo_impl.h"
#define SLBT_ARGV_SPARE_PTRS 16
-struct slbt_exec_ctx_impl {
- int argc;
- char * args;
- char * shadow;
- char * dsoprefix;
- size_t size;
- struct slbt_exec_ctx ctx;
- char * vbuffer[];
-};
-
-
static size_t slbt_parse_comma_separated_flags(
const char * str,
int * argc)
@@ -135,7 +125,8 @@ static struct slbt_exec_ctx_impl * slbt_exec_ctx_alloc(
ictx->size = size;
ictx->shadow = shadow;
- ictx->ctx.csrc = csrc;
+ ictx->ctx.csrc = csrc;
+ ictx->fdwrapper = (-1);
return ictx;
}
@@ -470,12 +461,13 @@ static int slbt_free_exec_ctx_impl(
struct slbt_exec_ctx_impl * ictx,
int status)
{
- if (ictx->ctx.fwrapper)
- fclose(ictx->ctx.fwrapper);
+ if (ictx->fdwrapper >= 0)
+ close(ictx->fdwrapper);
free(ictx->args);
free(ictx->shadow);
free (ictx);
+
return status;
}