summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-26 21:59:31 -0400
committermidipix <writeonce@midipix.org>2016-10-26 22:10:39 -0400
commit884fc433b4a5bd4a76e345e62d3ae1f0d30911c3 (patch)
treea96df2393c785a183219c60455b6e76a9d5774fc /src
parent4671adc25c3fbfcbd819178632cd5e7857810ac0 (diff)
downloadapimagic-884fc433b4a5bd4a76e345e62d3ae1f0d30911c3.tar.bz2
apimagic-884fc433b4a5bd4a76e345e62d3ae1f0d30911c3.tar.xz
utility: error trace and error information: initial integration.
Diffstat (limited to 'src')
-rw-r--r--src/driver/amgc_amain.c11
1 files changed, 5 insertions, 6 deletions
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);
}