From 7ed7e66b32a56fd1f16b73cd9aaccf59b0d64f27 Mon Sep 17 00:00:00 2001
From: midipix <writeonce@midipix.org>
Date: Tue, 25 Oct 2016 23:54:21 -0400
Subject: driver: status codes: refactor and normalize.

---
 src/driver/sfrt_amain.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'src')

diff --git a/src/driver/sfrt_amain.c b/src/driver/sfrt_amain.c
index 324a010..d9ee482 100644
--- a/src/driver/sfrt_amain.c
+++ b/src/driver/sfrt_amain.c
@@ -67,11 +67,13 @@ int sfrt_main(int argc, char ** argv, char ** envp)
 	const char **			unit;
 
 	if ((ret = sfrt_get_driver_ctx(argv,envp,SFRT_DRIVER_FLAGS,&dctx)))
-		return (ret == SFRT_USAGE) ? !--argc : 2;
+		return (ret == SFRT_USAGE)
+			? !--argc
+			: SFRT_ERROR;
 
 	if (dctx->cctx->drvflags & SFRT_DRIVER_VERSION)
 		if ((sfrt_version(dctx)) < 0)
-			return sfrt_exit(dctx,2);
+			return sfrt_exit(dctx,SFRT_ERROR);
 
 	if (dctx->cctx->anystring)				/* dummy */
 		if ((sfrt_output_dummy(dctx->cctx,stdout)) < 0)	/* dummy */
@@ -84,5 +86,5 @@ int sfrt_main(int argc, char ** argv, char ** envp)
 		}
 	}
 
-	return sfrt_exit(dctx,dctx->errv[0] ? 2 : 0);
+	return sfrt_exit(dctx,dctx->errv[0] ? SFRT_ERROR : SFRT_OK);
 }
-- 
cgit v1.2.3