summaryrefslogtreecommitdiffhomepage
path: root/src/driver
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-23 22:15:44 -0400
committermidipix <writeonce@midipix.org>2016-11-11 00:22:47 -0500
commita9007d5c41b587d26634c633068f9ec0fbe2dc87 (patch)
tree8a8e77f6bf8cfb38c2cf3de78424bcc1b825bd54 /src/driver
parentdc2117ff6b5094eacae9979617ee0df9be2fc0c9 (diff)
downloadmdso-a9007d5c41b587d26634c633068f9ec0fbe2dc87.tar.bz2
mdso-a9007d5c41b587d26634c633068f9ec0fbe2dc87.tar.xz
driver: added initial error info vector and buffer allocation.
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/mdso_driver_ctx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/driver/mdso_driver_ctx.c b/src/driver/mdso_driver_ctx.c
index a485320..d100c0a 100644
--- a/src/driver/mdso_driver_ctx.c
+++ b/src/driver/mdso_driver_ctx.c
@@ -78,6 +78,7 @@ static struct mdso_driver_ctx_impl * mdso_driver_ctx_alloc(
size_t size;
struct argv_entry * entry;
const char ** units;
+ int elements;
size = sizeof(struct mdso_driver_ctx_alloc);
size += (nunits+1)*sizeof(const char *);
@@ -92,9 +93,15 @@ static struct mdso_driver_ctx_impl * mdso_driver_ctx_alloc(
if (!entry->fopt)
*units++ = entry->arg;
+ 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.fdtmpin = -1;
ictx->ctx.ctx.units = ictx->units;
+ ictx->ctx.ctx.errv = ictx->ctx.errinfp;
return &ictx->ctx;
}