From 9706faf3b18a3fe231bff70e6d8acd62aaae99df Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 29 Jun 2018 01:00:36 -0400 Subject: execution context: generated wrapper: replaced the stream with a pure fd. --- src/logic/slbt_exec_ctx.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/logic/slbt_exec_ctx.c') 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 #include +#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; } -- cgit v1.2.3