UPSTREAM: cbmem: Exit with an errorlevel of 0 after printing help

cbmem --help should not return an error to the OS.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: Id00091c679dbb109bc352cf8a81d67c2ae5666ec
Reviewed-on: https://chromium-review.googlesource.com/385898
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Martin Roth 2016-09-11 15:43:22 -06:00 committed by chrome-bot
commit 60aa3f9eb0

View file

@ -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;
}
}