From 884fc433b4a5bd4a76e345e62d3ae1f0d30911c3 Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 26 Oct 2016 21:59:31 -0400 Subject: utility: error trace and error information: initial integration. --- src/driver/amgc_amain.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/driver/amgc_amain.c b/src/driver/amgc_amain.c index ceaa1ff..41b174c 100644 --- a/src/driver/amgc_amain.c +++ b/src/driver/amgc_amain.c @@ -53,10 +53,11 @@ static void amgc_perform_unit_actions(struct amgc_unit_ctx * uctx) amgc_perform_unit_action(uctx,action,0,stdout); } -static int amgc_exit(struct amgc_driver_ctx * dctx, int nerrors) +static int amgc_exit(struct amgc_driver_ctx * dctx, int ret) { + amgc_output_error_vector(dctx); amgc_free_driver_ctx(dctx); - return nerrors ? 2 : 0; + return ret; } int amgc_main(int argc, char ** argv, char ** envp) @@ -76,11 +77,9 @@ int amgc_main(int argc, char ** argv, char ** envp) for (unit=dctx->units; *unit; unit++) { if (!(amgc_get_unit_ctx(dctx,*unit,&uctx))) { amgc_perform_unit_actions(uctx); - ret += uctx->nerrors; amgc_free_unit_ctx(uctx); - } else - ret++; + } } - return amgc_exit(dctx,ret); + return amgc_exit(dctx,dctx->errv[0] ? 2 : 0); } -- cgit v1.2.3