From 76e27a79eddb6279bbbc0ec840d66b753a9ba0f3 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mon, 12 Jun 2017 12:50:54 +0200 Subject: ubi-utils: Return error code if command line option is unknown The tools in question 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. We need to return -1 instead of EXIT_FAILURE to be consistent with the other exit code places. Signed-off-by: Daniel Wagner Signed-off-by: David Oberhollenzer --- tests/fs-tests/integrity/integck.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c index 7cb5305..827adc5 100644 --- a/tests/fs-tests/integrity/integck.c +++ b/tests/fs-tests/integrity/integck.c @@ -3080,10 +3080,13 @@ static int parse_opts(int argc, char * const argv[]) exit(EXIT_SUCCESS); case 'h': - case '?': fprintf(stderr, "%s\n\n", doc); fprintf(stderr, "%s\n", optionsstr); exit(EXIT_SUCCESS); + case '?': + fprintf(stderr, "%s\n\n", doc); + fprintf(stderr, "%s\n", optionsstr); + exit(-1); case ':': return errmsg("parameter is missing"); -- cgit v1.2.3