diff options
author | midipix <writeonce@midipix.org> | 2016-09-03 17:26:35 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-09-05 00:07:10 -0400 |
commit | 66eddb4c9f619c072ac235fdb804b2e54a1b5927 (patch) | |
tree | 823d5c778611fc59b0181827393012193c2d90ad | |
parent | d3664501a5d4747c3328e12b033ea6e9d7683379 (diff) | |
download | slibtool-66eddb4c9f619c072ac235fdb804b2e54a1b5927.tar.bz2 slibtool-66eddb4c9f619c072ac235fdb804b2e54a1b5927.tar.xz |
utility: error trace and error information: initial integration.
-rw-r--r-- | src/driver/slbt_amain.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/driver/slbt_amain.c b/src/driver/slbt_amain.c index 3e2cf3a..8c29e8d 100644 --- a/src/driver/slbt_amain.c +++ b/src/driver/slbt_amain.c @@ -54,19 +54,19 @@ static ssize_t slbt_version(struct slbt_driver_ctx * dctx) static void slbt_perform_driver_actions(struct slbt_driver_ctx * dctx) { if (dctx->cctx->drvflags & SLBT_DRIVER_CONFIG) - dctx->nerrors += (slbt_output_config(dctx) < 0); + slbt_output_config(dctx); if (dctx->cctx->mode == SLBT_MODE_COMPILE) - dctx->nerrors += (slbt_exec_compile(dctx,0) < 0); + slbt_exec_compile(dctx,0); if (dctx->cctx->mode == SLBT_MODE_EXECUTE) - dctx->nerrors += (slbt_exec_execute(dctx,0) < 0); + slbt_exec_execute(dctx,0); if (dctx->cctx->mode == SLBT_MODE_INSTALL) - dctx->nerrors += (slbt_exec_install(dctx,0) < 0); + slbt_exec_install(dctx,0); if (dctx->cctx->mode == SLBT_MODE_LINK) - dctx->nerrors += (slbt_exec_link(dctx,0) < 0); + slbt_exec_link(dctx,0); } static void slbt_perform_unit_actions(struct slbt_unit_ctx * uctx) @@ -74,13 +74,11 @@ static void slbt_perform_unit_actions(struct slbt_unit_ctx * uctx) (void)uctx; } -static int slbt_exit(struct slbt_driver_ctx * dctx, int nerrors) +static int slbt_exit(struct slbt_driver_ctx * dctx, int ret) { - if (nerrors && errno) - strerror(errno); - + slbt_output_error_vector(dctx); slbt_free_driver_ctx(dctx); - return nerrors ? 2 : 0; + return ret; } int slbt_main(int argc, char ** argv, char ** envp) @@ -159,15 +157,13 @@ int slbt_main(int argc, char ** argv, char ** envp) return slbt_exit(dctx,2); slbt_perform_driver_actions(dctx); - ret += dctx->nerrors; for (unit=dctx->units; *unit; unit++) { if (!(slbt_get_unit_ctx(dctx,*unit,&uctx))) { slbt_perform_unit_actions(uctx); - ret += uctx->nerrors; slbt_free_unit_ctx(uctx); } } - return slbt_exit(dctx,ret); + return slbt_exit(dctx,dctx->errv[0] ? 2 : 0); } |