Revision: 19709
http://sourceforge.net/p/edk2/code/19709
Author: lersek
Date: 2016-01-21 18:40:05 +0000 (Thu, 21 Jan 2016)
Log Message:
-----------
ShellPkg: BcfgDisplayDump(): accumulate errors
Don't exit the command immediately when a variable access fails; continue
processing after printing the error message. Let the final return status
reflect any encountered errors.
This patch is intended as a functional improvement.
Cc: Jaben Carsey <[email protected]>
Cc: Ryan Harkin <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Jaben Carsey <[email protected]>
Modified Paths:
--------------
trunk/edk2/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
Modified:
trunk/edk2/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
===================================================================
---
trunk/edk2/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
2016-01-21 18:40:00 UTC (rev 19708)
+++
trunk/edk2/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
2016-01-21 18:40:05 UTC (rev 19709)
@@ -1051,12 +1051,15 @@
UINTN LoopVar2;
CHAR16 *DevPathString;
VOID *DevPath;
+ UINTN Errors;
if (OrderCount == 0) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_BCFG_NONE),
gShellBcfgHiiHandle, L"bcfg");
return (SHELL_SUCCESS);
}
+ Errors = 0;
+
for (LoopVar = 0 ; LoopVar < OrderCount ; LoopVar++) {
Buffer = NULL;
BufferSize = 0;
@@ -1083,7 +1086,8 @@
if (EFI_ERROR(Status) || Buffer == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_READ_FAIL),
gShellBcfgHiiHandle, L"bcfg", VariableName);
- return (SHELL_INVALID_PARAMETER);
+ ++Errors;
+ goto Cleanup;
}
if ((*(UINT16*)(Buffer+4)) != 0) {
@@ -1120,6 +1124,7 @@
L"\r\n");
}
+Cleanup:
if (Buffer != NULL) {
FreePool(Buffer);
}
@@ -1130,7 +1135,7 @@
FreePool(DevPathString);
}
}
- return (SHELL_SUCCESS);
+ return (Errors > 0) ? SHELL_INVALID_PARAMETER : SHELL_SUCCESS;
}
/**
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits