diff options
author | Qiu Shumin <shumin.qiu@intel.com> | 2015-12-18 07:27:50 +0000 |
---|---|---|
committer | vanjeff <vanjeff@Edk2> | 2015-12-18 07:27:50 +0000 |
commit | 1bd38073f35107cf8d6af0b294b9f2641287683d (patch) | |
tree | 8941f29341367bca4b08ae32438dee060a56a50a /ShellPkg | |
parent | 8368182d00a164b7b4d12ffc2c3c65cd51e749a7 (diff) | |
download | edk2-platforms-1bd38073f35107cf8d6af0b294b9f2641287683d.tar.xz |
ShellPkg: Print error message when Shell set environment variable fail.
If you try to 'set' a read only environment variable and it fails without printing any information.
This patch add error message printing when 'set' environment variable fails.
(Sync patch r18598 from main trunk.)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19392 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r-- | ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c | 7 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni | bin | 109570 -> 109742 bytes |
2 files changed, 6 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c index 45948e1275..d5e6a08978 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c @@ -2,7 +2,7 @@ Main file for attrib shell level 2 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -141,6 +141,11 @@ ShellCommandRunSet ( // assigning one
//
Status = ShellSetEnvironmentVariable(KeyName, Value, ShellCommandLineGetFlag(Package, L"-v"));
+ if (EFI_ERROR(Status)) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_ERROR_SET), gShellLevel2HiiHandle, L"set", KeyName);
+ ShellStatus = (SHELL_STATUS) (Status & (~MAX_BIT));
+ }
+
} else {
if (KeyName != NULL) {
//
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni Binary files differindex 29563d2e21..cc2c33cda4 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni |