Revision: 18598
          http://sourceforge.net/p/edk2/code/18598
Author:   shenshushi
Date:     2015-10-10 01:19:43 +0000 (Sat, 10 Oct 2015)
Log Message:
-----------
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.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <[email protected]>
Reviewed-by: Jaben Carsey <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c
    
trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni

Modified: trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c        
2015-10-09 18:55:41 UTC (rev 18597)
+++ trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c        
2015-10-10 01:19:43 UTC (rev 18598)
@@ -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 @@
         // 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) {
           //

Modified: 
trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni
===================================================================
--- 
trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni
       2015-10-09 18:55:41 UTC (rev 18597)
+++ 
trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni
       2015-10-10 01:19:43 UTC (rev 18598)
@@ -4,7 +4,7 @@
  - @@ -128,6 +128,8 @@
  +  

------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to