]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.c
Integrate patch from Andrew Fish to make it run on OS X.
[mirror_edk2.git] / UnixPkg / UnixSimpleFileSystemDxe / UnixSimpleFileSystem.c
index 84ba962739df47a6a7c5369d9250fe6924644f7f..d01fd4e7510b3d4b7b3384410a75f477211943b3 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2009, Intel Corporation                                                         \r
 All rights reserved. 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
@@ -566,6 +566,8 @@ Done:
 \r
       gBS->FreePool (PrivateFile);\r
     }\r
+    \r
+    *Root = NULL;\r
   }\r
 \r
   gBS->RestoreTPL (OldTpl);\r
@@ -1078,7 +1080,6 @@ Returns:
   return Status;\r
 }\r
 \r
-STATIC\r
 VOID\r
 UnixSystemTimeToEfiTime (\r
   EFI_UNIX_THUNK_PROTOCOL        *UnixThunk,\r
@@ -1120,7 +1121,6 @@ Returns:
   }\r
 }\r
 \r
-STATIC\r
 EFI_STATUS\r
 UnixSimpleFileSystemFileInfo (\r
   UNIX_EFI_FILE_PRIVATE          *PrivateFile,\r
@@ -1264,7 +1264,12 @@ Returns:
   CHAR8                   *FullFileName;\r
   EFI_TPL                 OldTpl;\r
 \r
-  if (This == NULL || BufferSize == NULL || Buffer == NULL) {\r
+  if (This == NULL || BufferSize == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+  \r
+  if ((*BufferSize != 0) && (Buffer == NULL)) {\r
+    // Buffer can be NULL  if *BufferSize is zero\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r