summaryrefslogtreecommitdiff
path: root/src/driver/slbt_amain.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-24 12:43:15 -0400
committermidipix <writeonce@midipix.org>2016-10-24 12:44:08 -0400
commit0254dfb578e56cdc5cfef8df959b45fb454e3a8f (patch)
tree21812f4d6ec45a28b8e27ebcbac4fdfd6abea013 /src/driver/slbt_amain.c
parent1379f79d286988f2582ff8efb1af736bf4229a3f (diff)
downloadslibtool-0254dfb578e56cdc5cfef8df959b45fb454e3a8f.tar.bz2
slibtool-0254dfb578e56cdc5cfef8df959b45fb454e3a8f.tar.xz
driver: status codes: refactor and normalize.
Diffstat (limited to 'src/driver/slbt_amain.c')
-rw-r--r--src/driver/slbt_amain.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/driver/slbt_amain.c b/src/driver/slbt_amain.c
index 5d1417e..4c66820 100644
--- a/src/driver/slbt_amain.c
+++ b/src/driver/slbt_amain.c
@@ -100,9 +100,9 @@ int slbt_main(int argc, char ** argv, char ** envp)
sargv[4] = 0;
return (slbt_get_driver_ctx(sargv,envp,SLBT_DRIVER_FLAGS,&dctx))
- ? 2 : (slbt_version(dctx) < 0)
- ? slbt_exit(dctx,2)
- : slbt_exit(dctx,0);
+ ? SLBT_ERROR : (slbt_version(dctx) < 0)
+ ? slbt_exit(dctx,SLBT_ERROR)
+ : slbt_exit(dctx,SLBT_OK);
}
/* program */
@@ -146,13 +146,15 @@ int slbt_main(int argc, char ** argv, char ** envp)
/* driver context */
if ((ret = slbt_get_driver_ctx(argv,envp,flags,&dctx)))
- return (ret == SLBT_USAGE) ? !--argc : 2;
+ return (ret == SLBT_USAGE)
+ ? !--argc
+ : SLBT_ERROR;
if (dctx->cctx->drvflags & SLBT_DRIVER_VERSION)
if ((slbt_version(dctx)) < 0)
- return slbt_exit(dctx,2);
+ return slbt_exit(dctx,SLBT_ERROR);
slbt_perform_driver_actions(dctx);
- return slbt_exit(dctx,dctx->errv[0] ? 2 : 0);
+ return slbt_exit(dctx,dctx->errv[0] ? SLBT_ERROR : SLBT_OK);
}