From 8448ac47d2d8ade2f28e71aab6dd12e2adfce443 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Sun, 11 Sep 2016 15:43:22 -0600 Subject: cbmem: Exit with an errorlevel of 0 after printing help cbmem --help should not return an error to the OS. Change-Id: Id00091c679dbb109bc352cf8a81d67c2ae5666ec Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/16574 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- util/cbmem/cbmem.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'util/cbmem') diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c index 885d460252..7b434d874c 100644 --- a/util/cbmem/cbmem.c +++ b/util/cbmem/cbmem.c @@ -886,7 +886,7 @@ static void print_version(void) "GNU General Public License for more details.\n\n"); } -static void print_usage(const char *name) +static void print_usage(const char *name, int exit_code) { printf("usage: %s [-cCltTxVvh?]\n", name); printf("\n" @@ -901,7 +901,7 @@ static void print_usage(const char *name) " -v | --version: print the version\n" " -h | --help: print this help\n" "\n"); - exit(1); + exit(exit_code); } #ifdef __arm__ @@ -1086,10 +1086,11 @@ int main(int argc, char** argv) exit(0); break; case 'h': + print_usage(argv[0], 0); + break; case '?': default: - print_usage(argv[0]); - exit(0); + print_usage(argv[0], 1); break; } } -- cgit v1.2.3