[PATCH v0 10/20] mtd-utils: nftl_format: Use defines for exit code values

Daniel Wagner daniel.wagner at siemens.com
Mon Jun 12 03:50:51 PDT 2017


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 at siemens.com>
---
 nand-utils/nftl_format.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/nand-utils/nftl_format.c b/nand-utils/nftl_format.c
index a329c59fc504..ea8199d5509d 100644
--- a/nand-utils/nftl_format.c
+++ b/nand-utils/nftl_format.c
@@ -234,7 +234,7 @@ int main(int argc, char **argv)
 	int idx = 0;
 
 	if (argc < 2)
-		usage(1);
+		usage(EXIT_FAILURE);
 
 	nftl = "NFTL";
 
@@ -249,13 +249,13 @@ int main(int argc, char **argv)
 				break;
 			case 'h':
 			case '?':
-				usage(0);
+				usage(EXIT_SUCCESS);
 				break;
 			case 'V':
 				display_version();
 				break;
 			default:
-				usage(1);
+				usage(EXIT_FAILURE);
 				break;
 		}
 	}
-- 
2.9.4




More information about the linux-mtd mailing list