From c9c5f77d90d27819aa63a49264cdb37364c663a5 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 24 Oct 2016 18:54:25 -0400 Subject: driver: added initial error info vector and buffer allocation. --- src/driver/pe_driver_ctx.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/driver') diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c index 29fd7c8..7ef510e 100644 --- a/src/driver/pe_driver_ctx.c +++ b/src/driver/pe_driver_ctx.c @@ -74,6 +74,7 @@ static struct pe_driver_ctx_impl * pe_driver_ctx_alloc( size_t size; struct argv_entry * entry; const char ** units; + int elements; size = sizeof(struct pe_driver_ctx_alloc); size += (nunits+1)*sizeof(const char *); @@ -84,6 +85,11 @@ static struct pe_driver_ctx_impl * pe_driver_ctx_alloc( if (cctx) memcpy(&ictx->ctx.cctx,cctx,sizeof(*cctx)); + elements = sizeof(ictx->ctx.erribuf) / sizeof(*ictx->ctx.erribuf); + + ictx->ctx.errinfp = &ictx->ctx.erriptr[0]; + ictx->ctx.erricap = &ictx->ctx.erriptr[--elements]; + ictx->meta = meta; ictx->ctx.cctx.symctx = &ictx->ctx.symctx; ictx->ctx.cctx.outctx = &ictx->ctx.outctx; @@ -96,6 +102,7 @@ static struct pe_driver_ctx_impl * pe_driver_ctx_alloc( *units++ = entry->arg; ictx->ctx.ctx.units = ictx->units; + ictx->ctx.ctx.errv = ictx->ctx.errinfp; return &ictx->ctx; } -- cgit v1.2.3