diff options
author | midipix <writeonce@midipix.org> | 2016-10-25 23:49:24 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-10-26 00:05:08 -0400 |
commit | f530d33848301907a4f1ed98a65c0f5be9139693 (patch) | |
tree | f68d916558e4ef2b3bc5223b7fca0029080eb67d /src/driver | |
parent | 3be86d2cc36db6b3fea94a35c1c61fca8c087aff (diff) | |
download | sofort-f530d33848301907a4f1ed98a65c0f5be9139693.tar.bz2 sofort-f530d33848301907a4f1ed98a65c0f5be9139693.tar.xz |
utility: error trace and error information: initial integration.
Diffstat (limited to 'src/driver')
-rw-r--r-- | src/driver/sfrt_amain.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/driver/sfrt_amain.c b/src/driver/sfrt_amain.c index ebed412..324a010 100644 --- a/src/driver/sfrt_amain.c +++ b/src/driver/sfrt_amain.c @@ -45,22 +45,18 @@ static void sfrt_perform_unit_actions( { uint64_t flags = dctx->cctx->actflags; /* dummy */ /* dummy */ - if (flags & SFRT_OUTPUT_NAME) { /* dummy */ - uctx->status = sfrt_output_name(uctx,stdout); /* dummy */ - uctx->nerrors += !!uctx->status; /* dummy */ - } /* dummy */ + if (flags & SFRT_OUTPUT_NAME) /* dummy */ + sfrt_output_name(uctx,stdout); /* dummy */ /* dummy */ - if (flags & SFRT_OUTPUT_ADDRESS) { /* dummy */ - uctx->status = sfrt_output_address(uctx,stdout);/* dummy */ - uctx->nerrors += !!uctx->status; /* dummy */ - } /* dummy */ - (void)uctx; + if (flags & SFRT_OUTPUT_ADDRESS) /* dummy */ + sfrt_output_address(uctx,stdout); /* dummy */ } -static int sfrt_exit(struct sfrt_driver_ctx * dctx, int nerrors) +static int sfrt_exit(struct sfrt_driver_ctx * dctx, int ret) { + sfrt_output_error_vector(dctx); sfrt_free_driver_ctx(dctx); - return nerrors ? 2 : 0; + return ret; } int sfrt_main(int argc, char ** argv, char ** envp) @@ -84,10 +80,9 @@ int sfrt_main(int argc, char ** argv, char ** envp) for (unit=dctx->units; *unit; unit++) { if (!(sfrt_get_unit_ctx(dctx,*unit,&uctx))) { sfrt_perform_unit_actions(dctx,uctx); - ret += uctx->nerrors; sfrt_free_unit_ctx(uctx); } } - return sfrt_exit(dctx,ret); + return sfrt_exit(dctx,dctx->errv[0] ? 2 : 0); } |