diff mbox

[v0,09/20] mtd-utils: nandtest: Use defines for exit code values

Message ID 20170612105101.18223-10-daniel.wagner@siemens.com
State Accepted
Delegated to: David Oberhollenzer
Headers show

Commit Message

Daniel Wagner June 12, 2017, 10:50 a.m. UTC
The tool will quit with an exit code 0 if the command line option was
not recognized. By returning an error code a calling script has the
possibility to distinguish between a real success and an invalid
invocation.

Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com>
---
 nand-utils/nandtest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/nand-utils/nandtest.c b/nand-utils/nandtest.c
index 56767337846b..9e39446de257 100644
--- a/nand-utils/nandtest.c
+++ b/nand-utils/nandtest.c
@@ -181,14 +181,14 @@  int main(int argc, char **argv)
 
 		switch (c) {
 		case 'h':
-			usage(0);
+			usage(EXIT_SUCCESS);
 			break;
 		case 'V':
 			common_print_version();
 			exit(EXIT_SUCCESS);
 			break;
 		case '?':
-			usage(1);
+			usage(EXIT_FAILURE);
 			break;
 
 		case 'm':
@@ -222,7 +222,7 @@  int main(int argc, char **argv)
 		}
 	}
 	if (argc - optind != 1)
-		usage(1);
+		usage(EXIT_FAILURE);
 	if (error)
 		errmsg_die("Try --help for more information");