From: Ruiyu Ni Date: Tue, 6 Jun 2017 05:26:12 +0000 (+0800) Subject: ShellPkg/alias: Return status for alias deletion X-Git-Tag: edk2-stable201903~3957 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=7bd5a2c81ed5bc52ed63b348fcb1686f1fb5b398;hp=9c94cc2ca270c2a9121c485281792c178281ac7d ShellPkg/alias: Return status for alias deletion Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Reviewed-by: Tapan Shah Reviewed-by: Jaben Carsey --- 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