/** @file\r
Main file for exit shell level 1 function.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
LIST_ENTRY *Package;\r
CHAR16 *ProblemParam;\r
SHELL_STATUS ShellStatus;\r
+ UINT64 RetVal;\r
+ CONST CHAR16 *Return;\r
\r
ShellStatus = SHELL_SUCCESS;\r
\r
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);\r
if (EFI_ERROR(Status)) {\r
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {\r
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, ProblemParam);\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, L"exit", ProblemParam);\r
FreePool(ProblemParam);\r
ShellStatus = SHELL_INVALID_PARAMETER;\r
} else {\r
}\r
} else {\r
\r
- //\r
- // If we are in a batch file and /b then pass TRUE otherwise false...\r
- //\r
- ShellCommandRegisterExit((BOOLEAN)(gEfiShellProtocol->BatchIsActive() && ShellCommandLineGetFlag(Package, L"/b")));\r
-\r
//\r
// return the specified error code\r
//\r
- if (ShellCommandLineGetRawValue(Package, 1) != NULL) {\r
- ShellStatus = (SHELL_STATUS)(ShellStrToUintn(ShellCommandLineGetRawValue(Package, 1)));\r
+ Return = ShellCommandLineGetRawValue(Package, 1);\r
+ if (Return != NULL) {\r
+ Status = ShellConvertStringToUint64(Return, &RetVal, FALSE, FALSE);\r
+ if (EFI_ERROR(Status)) {\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel1HiiHandle, L"exit", Return);\r
+ ShellStatus = SHELL_INVALID_PARAMETER;\r
+ } else {\r
+ //\r
+ // If we are in a batch file and /b then pass TRUE otherwise false...\r
+ //\r
+ ShellCommandRegisterExit((BOOLEAN)(gEfiShellProtocol->BatchIsActive() && ShellCommandLineGetFlag(Package, L"/b")), RetVal);\r
+\r
+ ShellStatus = SHELL_SUCCESS;\r
+ }\r
+ } else {\r
+ // If we are in a batch file and /b then pass TRUE otherwise false...\r
+ //\r
+ ShellCommandRegisterExit((BOOLEAN)(gEfiShellProtocol->BatchIsActive() && ShellCommandLineGetFlag(Package, L"/b")), 0);\r
+\r
+ ShellStatus = SHELL_SUCCESS;\r
}\r
\r
ShellCommandLineFreeVarList (Package);\r