summaryrefslogtreecommitdiff
path: root/util/cbmem
diff options
context:
space:
mode:
authorMartin Roth <martinroth@google.com>2016-09-11 15:43:22 -0600
committerMartin Roth <martinroth@google.com>2016-09-15 00:43:02 +0200
commit8448ac47d2d8ade2f28e71aab6dd12e2adfce443 (patch)
tree9b3991f2702198449f3f403561f9ae6367c2a436 /util/cbmem
parentfbce31a2cc560a316ed6aadac3e8e5c95a095178 (diff)
downloadcoreboot-8448ac47d2d8ade2f28e71aab6dd12e2adfce443.tar.xz
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 <martinroth@google.com> Reviewed-on: https://review.coreboot.org/16574 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'util/cbmem')
-rw-r--r--util/cbmem/cbmem.c9
1 files changed, 5 insertions, 4 deletions
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;
}
}