mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-07 16:11:43 +00:00
Better arg checking for reboot command
Allows 'reboot cold' as an alias for 'reboot hard', since I keep
mis-typing that anyway. Returns error for any other option.
('reboot' by itself still does a warm reboot).
BUG=none
TEST=manual
reboot -> does warm reboot
reboot hard -> does hard reboot (reason = rtc alarm)
reboot cold -> ditto
reboot foo -> prints error
Change-Id: I183714d4ba09abee3bd9a6f0d5df82389becf410
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26924
This commit is contained in:
@@ -652,9 +652,13 @@ static int command_reboot(int argc, char **argv)
|
||||
{
|
||||
int is_hard = 0;
|
||||
|
||||
if (argc == 2 && !strcasecmp(argv[1], "hard")) {
|
||||
ccputs("Hard-");
|
||||
is_hard = 1;
|
||||
if (argc == 2) {
|
||||
if (!strcasecmp(argv[1], "hard") ||
|
||||
!strcasecmp(argv[1], "cold")) {
|
||||
ccputs("Hard-");
|
||||
is_hard = 1;
|
||||
} else
|
||||
return EC_ERROR_PARAM1;
|
||||
}
|
||||
|
||||
ccputs("Rebooting!\n\n\n");
|
||||
|
||||
Reference in New Issue
Block a user