summaryrefslogtreecommitdiff
path: root/src/logic/slbt_exec_ctx.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-06-29 01:00:36 -0400
committermidipix <writeonce@midipix.org>2018-06-29 01:37:44 -0400
commit9706faf3b18a3fe231bff70e6d8acd62aaae99df (patch)
tree4bd85493b914dd8565c36776ec85814009c7532b /src/logic/slbt_exec_ctx.c
parentc178e3616873d4bb6d94d6fb68633497a4df0ef5 (diff)
downloadslibtool-9706faf3b18a3fe231bff70e6d8acd62aaae99df.tar.bz2
slibtool-9706faf3b18a3fe231bff70e6d8acd62aaae99df.tar.xz
execution context: generated wrapper: replaced the stream with a pure fd.
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;
}