summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-24 22:18:40 -0400
committermidipix <writeonce@midipix.org>2016-11-10 23:35:53 -0500
commitb0d024b2b8e1c1ef88b57240afdec7e85ae9d482 (patch)
tree376289d19deb5023b5418132f645e393bfa84a0a /src
parent6e198d5feecf7916fc12c683435633806152c92b (diff)
downloadperk-b0d024b2b8e1c1ef88b57240afdec7e85ae9d482.tar.bz2
perk-b0d024b2b8e1c1ef88b57240afdec7e85ae9d482.tar.xz
driver: status codes: refactor and normalize.
Diffstat (limited to 'src')
-rw-r--r--src/driver/pe_amain.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/driver/pe_amain.c b/src/driver/pe_amain.c
index be3d09f..d7f0046 100644
--- a/src/driver/pe_amain.c
+++ b/src/driver/pe_amain.c
@@ -93,11 +93,13 @@ int pe_main(int argc, char ** argv, char ** envp)
const char ** unit;
if ((ret = pe_get_driver_ctx(argv,envp,PERK_DRIVER_FLAGS,&dctx)))
- return (ret == PERK_USAGE) ? !--argc : 2;
+ return (ret == PERK_USAGE)
+ ? !--argc
+ : PERK_ERROR;
if (dctx->cctx->drvflags & PERK_DRIVER_VERSION)
if ((pe_version(dctx)) < 0)
- return pe_exit(dctx,2);
+ return pe_exit(dctx,PERK_ERROR);
for (unit=dctx->units; *unit; unit++) {
if (!(pe_get_unit_ctx(dctx,*unit,&uctx))) {
@@ -106,5 +108,5 @@ int pe_main(int argc, char ** argv, char ** envp)
}
}
- return pe_exit(dctx,dctx->errv[0] ? 2 : 0);
+ return pe_exit(dctx,dctx->errv[0] ? PERK_ERROR : PERK_OK);
}