summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}