summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaben Carsey <jaben.carsey@intel.com>2014-01-16 16:52:39 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2014-01-16 16:52:39 +0000
commit31b018a663be0fb23f3a4f612aaedf86a8bd10fc (patch)
tree0cd2d4f04e5ff4bb0c5a94aeb830d56836da0ef1
parent974d61171fcbd33374c626ea69adc2519402d830 (diff)
downloadedk2-platforms-31b018a663be0fb23f3a4f612aaedf86a8bd10fc.tar.xz
ShellPkg: Remove ASSERT
This change removes ASSERT statements and replaces them with logic to break out of the loop. This both prevents spinning forever and prevents processing the returned data from the function that failed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15133 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 9b58786756..10c6b592fd 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -3280,7 +3280,9 @@ ShellPromptForResponse (
//
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
+ if (EFI_ERROR(Status)) {
+ break;
+ }
ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
if (Key.UnicodeChar == L'Q' || Key.UnicodeChar ==L'q') {
*Resp = ShellPromptResponseQuit;
@@ -3303,7 +3305,9 @@ ShellPromptForResponse (
}
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
+ if (EFI_ERROR(Status)) {
+ break;
+ }
ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
switch (Key.UnicodeChar) {
case L'Y':
@@ -3335,7 +3339,9 @@ ShellPromptForResponse (
}
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
+ if (EFI_ERROR(Status)) {
+ break;
+ }
ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
switch (Key.UnicodeChar) {
case L'Y':
@@ -3374,7 +3380,9 @@ ShellPromptForResponse (
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
if (Type == ShellPromptResponseTypeEnterContinue) {
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
+ if (EFI_ERROR(Status)) {
+ break;
+ }
ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
*Resp = ShellPromptResponseContinue;
@@ -3404,7 +3412,9 @@ ShellPromptForResponse (
}
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
+ if (EFI_ERROR(Status)) {
+ break;
+ }
ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
switch (Key.UnicodeChar) {
case L'Y':
@@ -3429,7 +3439,9 @@ ShellPromptForResponse (
}
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
+ if (EFI_ERROR(Status)) {
+ break;
+ }
ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
break;