If the call to SetVariable is to delete the variable,
but the variable was not found, then we return EFI_SUCCESS
rather than EFI_NOT_FOUND.
Signed-off-by: jljusten
Reviewed-by: jcarsey
Reviewed-by: geekboy15a
Reviewed-by: niruiyu
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11840
6f19259b-4bc3-4df7-8a09-
765794883524
//\r
// Finally, Update the variable of the default console by NewDevicePath\r
//\r
+ DevicePathSize = GetDevicePathSize (NewDevicePath);\r
Status = gRT->SetVariable (\r
ConVarName,\r
&gEfiGlobalVariableGuid,\r
Attributes,\r
- GetDevicePathSize (NewDevicePath),\r
+ DevicePathSize,\r
NewDevicePath\r
);\r
+ if ((DevicePathSize == 0) && (Status == EFI_NOT_FOUND)) {\r
+ Status = EFI_SUCCESS;\r
+ }\r
ASSERT_EFI_ERROR (Status);\r
\r
if (VarConsole == NewDevicePath) {\r
}\r
}\r
\r
- return EFI_SUCCESS;\r
+ return Status;\r
\r
}\r
\r