diff options
author | Shumin Qiu <shumin.qiu@intel.com> | 2014-01-28 00:59:46 +0000 |
---|---|---|
committer | shenshushi <shenshushi@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-01-28 00:59:46 +0000 |
commit | 71c49eafc54f2f3158ed8861a90cb6eb95e13f97 (patch) | |
tree | 71346918ea718b3656593cc14ec8d24bdc610283 /ShellPkg/Application/Shell/Shell.c | |
parent | 7bc3ec3d80985b10bf8f4f9c4203ccd8c1cd6e7e (diff) | |
download | edk2-platforms-71c49eafc54f2f3158ed8861a90cb6eb95e13f97.tar.xz |
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
Diffstat (limited to 'ShellPkg/Application/Shell/Shell.c')
-rw-r--r-- | ShellPkg/Application/Shell/Shell.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c index dc99c5c974..18055d5a85 100644 --- a/ShellPkg/Application/Shell/Shell.c +++ b/ShellPkg/Application/Shell/Shell.c @@ -300,6 +300,12 @@ UefiMain ( // install our console logger. This will keep a log of the output for back-browsing
//
Status = ConsoleLoggerInstall(ShellInfoObject.LogScreenCount, &ShellInfoObject.ConsoleInfo);
+ if(EFI_ERROR (Status)) {
+ ExitStatus = (SHELL_STATUS) (Status & (~MAX_BIT));
+ } else {
+ ExitStatus = SHELL_SUCCESS;
+ }
+
if (!EFI_ERROR(Status)) {
//
// Enable the cursor to be visible
@@ -2074,6 +2080,7 @@ RunCommandOrFile( Status = EFI_SUCCESS;
CommandWithPath = NULL;
DevPath = NULL;
+ CalleeExitStatus = SHELL_INVALID_PARAMETER;
switch (Type) {
case Internal_Command:
@@ -2149,11 +2156,17 @@ RunCommandOrFile( SHELL_FREE_NON_NULL(DevPath);
+ if(EFI_ERROR (Status)) {
+ CalleeExitStatus = (SHELL_STATUS) (Status & (~MAX_BIT));
+ } else {
+ CalleeExitStatus = SHELL_SUCCESS;
+ }
+
//
// Update last error status.
//
// Status is an EFI_STATUS. Clear top bit to convert to SHELL_STATUS
- SetLastError((SHELL_STATUS) (Status & (~MAX_BIT)));
+ SetLastError(CalleeExitStatus);
break;
default:
//
|