Reviewed-by: Jaben Carsey <jaben.car...@intel.com>
> -----Original Message----- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of > Qiu Shumin > Sent: Friday, October 09, 2015 6:16 AM > To: edk2-devel@lists.01.org > Cc: Carsey, Jaben <jaben.car...@intel.com>; Qiu, Shumin > <shumin....@intel.com> > Subject: [edk2] [PATCH] ShellPkg: Print error message when Shell set > environment variable fail. > Importance: High > > 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. > > Cc: Jaben Carsey <jaben.car...@intel.com> > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Qiu Shumin <shumin....@intel.com> > --- > ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c | 7 ++++++- > .../UefiShellLevel2CommandsLib.uni | Bin 109570 -> 109742 > bytes > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c > b/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c > index 45948e1..d5e6a08 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/UefiShellLevel2Commands > Lib.uni > b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2Commands > Lib.uni > index > 29563d2e21737be3c84a7e3413596a4fc8e0850b..cc2c33cda4a6bf1c4f5dbc8527 > dfaaab5185ca53 100644 > GIT binary patch > delta 93 > zcmZp=!M5%u+k_{KrW>CgSD0+TAu%~mo`c_&AqWWlfjFKan89_jqps- > W2b@Ne6F6B! > t6B&{iau`w>6c|bv@_}SAkX<tQVW{ln4Vp5O9hBIb&na#{r^sm11pq_q8_WOz > > delta 27 > jcmZ2?ldb6n+k_{KCL5m~SD3s(Q>M8@X?uwhqg59Gwb%>C > > -- > 1.9.5.msysgit.1 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel