From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D7CD221967BD9 for ; Tue, 6 Jun 2017 01:28:02 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jun 2017 01:29:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,305,1493708400"; d="scan'208";a="977280753" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.1]) by orsmga003.jf.intel.com with ESMTP; 06 Jun 2017 01:29:08 -0700 From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Tue, 6 Jun 2017 16:29:04 +0800 Message-Id: <20170606082904.195040-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 Subject: [PATCH] ShellPkg/alias: Return status for alias deletion X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jun 2017 08:28:03 -0000 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Tapan Shah --- ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c index 5a3b7e5913..7277bd4b90 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c @@ -2,7 +2,7 @@ Main file for Alias shell level 3 function. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
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 @@ -151,6 +151,15 @@ ShellCommandRunAlias ( // delete an alias // Status = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE); + if (EFI_ERROR(Status)) { + if (Status == EFI_ACCESS_DENIED) { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle, L"alias"); + ShellStatus = SHELL_ACCESS_DENIED; + } else { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, L"alias", Status); + ShellStatus = SHELL_DEVICE_ERROR; + } + } } else if (ShellCommandLineGetCount(Package) == 3) { // // must be adding an alias -- 2.12.2.windows.2