summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-24 22:10:47 -0400
committermidipix <writeonce@midipix.org>2016-11-10 23:35:53 -0500
commita25e4bea6d66c8066d1c131aed35b2d70e7d4f6e (patch)
tree865283e8a66b5878685cf34b34572ff30092d2bb /src
parenteed8012ce892877caa16f1130a5e8037e672f043 (diff)
downloadperk-a25e4bea6d66c8066d1c131aed35b2d70e7d4f6e.tar.bz2
perk-a25e4bea6d66c8066d1c131aed35b2d70e7d4f6e.tar.xz
utility: error trace and error information: initial integration.
Diffstat (limited to 'src')
-rw-r--r--src/driver/pe_amain.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/driver/pe_amain.c b/src/driver/pe_amain.c
index 9ac0a9e..be3d09f 100644
--- a/src/driver/pe_amain.c
+++ b/src/driver/pe_amain.c
@@ -67,23 +67,22 @@ static void pe_perform_unit_actions(
uint64_t flags = dctx->cctx->fmtflags;
if (flags & PERK_OUTPUT_EXPORT_SYMS) {
- uctx->status = pe_output_export_symbols(dctx,uctx->meta,0);
- uctx->nerrors += !!uctx->status;
+ pe_output_export_symbols(dctx,uctx->meta,0);
fpara += uctx->meta->summary.nexpsyms;
}
if ((flags & PERK_OUTPUT_IMPORT_LIBS) || (flags & PERK_OUTPUT_IMPORT_SYMS)) {
pe_paragraph_break(dctx,&fpara);
- uctx->status = pe_output_import_libraries(dctx,uctx->meta,0);
- uctx->nerrors += !!uctx->status;
+ pe_output_import_libraries(dctx,uctx->meta,0);
fpara += (uctx->meta->summary.nimplibs > 0);
}
}
-static int pe_exit(struct pe_driver_ctx * dctx, int nerrors)
+static int pe_exit(struct pe_driver_ctx * dctx, int ret)
{
+ pe_output_error_vector(dctx);
pe_free_driver_ctx(dctx);
- return nerrors ? 2 : 0;
+ return ret;
}
int pe_main(int argc, char ** argv, char ** envp)
@@ -103,10 +102,9 @@ int pe_main(int argc, char ** argv, char ** envp)
for (unit=dctx->units; *unit; unit++) {
if (!(pe_get_unit_ctx(dctx,*unit,&uctx))) {
pe_perform_unit_actions(dctx,uctx);
- ret += uctx->nerrors;
pe_free_unit_ctx(uctx);
}
}
- return pe_exit(dctx,ret);
+ return pe_exit(dctx,dctx->errv[0] ? 2 : 0);
}