]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
ShellPkg/[hex]edit: Fix mouse freeze issue
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel2CommandsLib / Rm.c
index 0b23fba150815204e2180ac5e8ba9ca7ff4fee9e..288e7666a819ef9f903a079a149f993398ed3f51 100644 (file)
@@ -2,7 +2,7 @@
   Main file for attrib shell level 2 function.\r
 \r
   (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -29,11 +29,11 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
   @retval FALSE The directory has at least 1 file or directory in it.\r
 **/\r
 BOOLEAN\r
-EFIAPI\r
 IsDirectoryEmpty (\r
   IN EFI_HANDLE   FileHandle\r
   )\r
 {\r
+  EFI_STATUS      Status;\r
   EFI_FILE_INFO   *FileInfo;\r
   BOOLEAN         NoFile;\r
   BOOLEAN         RetVal;\r
@@ -42,8 +42,8 @@ IsDirectoryEmpty (
   NoFile = FALSE;\r
   FileInfo = NULL;\r
 \r
-  for (FileHandleFindFirstFile(FileHandle, &FileInfo)\r
-    ;  !NoFile\r
+  for (Status = FileHandleFindFirstFile(FileHandle, &FileInfo)\r
+    ;  !NoFile && !EFI_ERROR (Status)\r
     ;  FileHandleFindNextFile(FileHandle, FileInfo, &NoFile)\r
    ){\r
     if (StrStr(FileInfo->FileName, L".") != FileInfo->FileName\r
@@ -66,7 +66,6 @@ IsDirectoryEmpty (
   @retval SHELL_DEVICE_ERROR  A device error occured reading this Node.\r
 **/\r
 SHELL_STATUS\r
-EFIAPI\r
 CascadeDelete(\r
   IN EFI_SHELL_FILE_INFO  *Node,\r
   IN CONST BOOLEAN        Quiet\r
@@ -195,7 +194,6 @@ CascadeDelete(
   @param[in] Package    RESERVED.  Not used.\r
 **/\r
 BOOLEAN\r
-EFIAPI\r
 IsValidDeleteTarget(\r
   IN CONST EFI_SHELL_FILE_INFO  *List,\r
   IN CONST EFI_SHELL_FILE_INFO  *Node,\r