diff options
author | midipix <writeonce@midipix.org> | 2016-10-24 13:07:39 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-11-11 00:22:50 -0500 |
commit | 99b875dda2bc51ebc832fb9e380d3bdcc1097c8f (patch) | |
tree | 037363ba9948e245b2e1897cfcaa12583dc4663d | |
parent | 461b1f7c8ca47552875770ca4af8609ec8a0e802 (diff) | |
download | mdso-99b875dda2bc51ebc832fb9e380d3bdcc1097c8f.tar.bz2 mdso-99b875dda2bc51ebc832fb9e380d3bdcc1097c8f.tar.xz |
driver: status codes: refactor and normalize.
-rw-r--r-- | include/mdso/mdso.h | 5 | ||||
-rw-r--r-- | src/driver/mdso_amain.c | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/include/mdso/mdso.h b/include/mdso/mdso.h index 9943fc3..eba41ad 100644 --- a/include/mdso/mdso.h +++ b/include/mdso/mdso.h @@ -21,10 +21,7 @@ extern "C" { /* status codes */ #define MDSO_OK 0x00 #define MDSO_USAGE 0x01 -#define MDSO_BAD_OPT 0x02 -#define MDSO_BAD_OPT_VAL 0x03 -#define MDSO_IO_ERROR 0xA0 -#define MDSO_MAP_ERROR 0xA1 +#define MDSO_ERROR 0x02 /* driver flags */ #define MDSO_DRIVER_VERBOSITY_NONE 0x0000 diff --git a/src/driver/mdso_amain.c b/src/driver/mdso_amain.c index 3dbf215..b2e36f1 100644 --- a/src/driver/mdso_amain.c +++ b/src/driver/mdso_amain.c @@ -72,11 +72,13 @@ int mdso_main(int argc, char ** argv, char ** envp) const char ** unit; if ((ret = mdso_get_driver_ctx(argv,envp,MDSO_DRIVER_FLAGS,&dctx))) - return (ret == MDSO_USAGE) ? !--argc : 2; + return (ret == MDSO_USAGE) + ? !--argc + : MDSO_ERROR; if (dctx->cctx->drvflags & MDSO_DRIVER_VERSION) if ((mdso_version(dctx)) < 0) - return mdso_exit(dctx,2); + return mdso_exit(dctx,MDSO_ERROR); for (unit=dctx->units; *unit && !dctx->errv[0]; unit++) { if (!(mdso_get_unit_ctx(dctx,*unit,&uctx))) { @@ -88,5 +90,5 @@ int mdso_main(int argc, char ** argv, char ** envp) if (*dctx->units && !dctx->errv[0]) mdso_create_implib_sources(dctx); - return mdso_exit(dctx,dctx->errv[0] ? 2 : 0); + return mdso_exit(dctx,dctx->errv[0] ? MDSO_ERROR : MDSO_OK); } |