Add initializing code for local variable 'CalleeExitStatus' and 'ExitStatus' in 'Shell.c'.
Signed-off-by: Shumin Qiu <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15191 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -300,6 +300,12 @@ UefiMain (
|
|||||||
// install our console logger. This will keep a log of the output for back-browsing
|
// install our console logger. This will keep a log of the output for back-browsing
|
||||||
//
|
//
|
||||||
Status = ConsoleLoggerInstall(ShellInfoObject.LogScreenCount, &ShellInfoObject.ConsoleInfo);
|
Status = ConsoleLoggerInstall(ShellInfoObject.LogScreenCount, &ShellInfoObject.ConsoleInfo);
|
||||||
|
if(EFI_ERROR (Status)) {
|
||||||
|
ExitStatus = (SHELL_STATUS) (Status & (~MAX_BIT));
|
||||||
|
} else {
|
||||||
|
ExitStatus = SHELL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
if (!EFI_ERROR(Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
//
|
//
|
||||||
// Enable the cursor to be visible
|
// Enable the cursor to be visible
|
||||||
@ -2074,6 +2080,7 @@ RunCommandOrFile(
|
|||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
CommandWithPath = NULL;
|
CommandWithPath = NULL;
|
||||||
DevPath = NULL;
|
DevPath = NULL;
|
||||||
|
CalleeExitStatus = SHELL_INVALID_PARAMETER;
|
||||||
|
|
||||||
switch (Type) {
|
switch (Type) {
|
||||||
case Internal_Command:
|
case Internal_Command:
|
||||||
@ -2149,11 +2156,17 @@ RunCommandOrFile(
|
|||||||
|
|
||||||
SHELL_FREE_NON_NULL(DevPath);
|
SHELL_FREE_NON_NULL(DevPath);
|
||||||
|
|
||||||
|
if(EFI_ERROR (Status)) {
|
||||||
|
CalleeExitStatus = (SHELL_STATUS) (Status & (~MAX_BIT));
|
||||||
|
} else {
|
||||||
|
CalleeExitStatus = SHELL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update last error status.
|
// Update last error status.
|
||||||
//
|
//
|
||||||
// Status is an EFI_STATUS. Clear top bit to convert to SHELL_STATUS
|
// Status is an EFI_STATUS. Clear top bit to convert to SHELL_STATUS
|
||||||
SetLastError((SHELL_STATUS) (Status & (~MAX_BIT)));
|
SetLastError(CalleeExitStatus);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user