summaryrefslogtreecommitdiffhomepage
path: root/src/driver
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-24 18:54:25 -0400
committermidipix <writeonce@midipix.org>2016-11-10 23:35:51 -0500
commitc9c5f77d90d27819aa63a49264cdb37364c663a5 (patch)
treeb5ae312d3b35f2c8d519468e61fd1a789848a199 /src/driver
parente8769a78fcf3df8b492adff165e1bcb3014ad95a (diff)
downloadperk-c9c5f77d90d27819aa63a49264cdb37364c663a5.tar.bz2
perk-c9c5f77d90d27819aa63a49264cdb37364c663a5.tar.xz
driver: added initial error info vector and buffer allocation.
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/pe_driver_ctx.c7
1 files changed, 7 insertions, 0 deletions
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;
}