summaryrefslogtreecommitdiff
path: root/UnixPkg/UnixSimpleFileSystemDxe
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-25 07:29:13 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-25 07:29:13 +0000
commitccd55824e79865a04b1c872bda4af0f1de1f50be (patch)
treee67acf21c32a61eeaebf1f28d87df97732b80187 /UnixPkg/UnixSimpleFileSystemDxe
parent7f22d35110e43be45a0e16a2e944feebbf51e4ed (diff)
downloadedk2-platforms-ccd55824e79865a04b1c872bda4af0f1de1f50be.tar.xz
Integrate patch from Andrew Fish to make it run on OS X.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9194 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg/UnixSimpleFileSystemDxe')
-rw-r--r--UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.c11
-rw-r--r--UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.h6
2 files changed, 12 insertions, 5 deletions
diff --git a/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.c b/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.c
index 9d9325c105..d01fd4e751 100644
--- a/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.c
+++ b/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006 - 2007, Intel Corporation
+Copyright (c) 2006 - 2009, 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
@@ -566,6 +566,8 @@ Done:
gBS->FreePool (PrivateFile);
}
+
+ *Root = NULL;
}
gBS->RestoreTPL (OldTpl);
@@ -1262,7 +1264,12 @@ Returns:
CHAR8 *FullFileName;
EFI_TPL OldTpl;
- if (This == NULL || BufferSize == NULL || Buffer == NULL) {
+ if (This == NULL || BufferSize == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ if ((*BufferSize != 0) && (Buffer == NULL)) {
+ // Buffer can be NULL if *BufferSize is zero
return EFI_INVALID_PARAMETER;
}
diff --git a/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.h b/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.h
index 59fe085b70..1b6395540d 100644
--- a/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.h
+++ b/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.h
@@ -68,13 +68,13 @@ typedef struct {
EFI_UNIX_THUNK_PROTOCOL *UnixThunk;
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SimpleFileSystem;
EFI_FILE EfiFile;
- INTN fd;
- DIR *Dir;
+ INTN fd;
+ DIR *Dir;
BOOLEAN IsRootDirectory;
BOOLEAN IsDirectoryPath;
BOOLEAN IsOpenedByRead;
char *FileName;
- struct dirent *Dirent;
+ struct dirent *Dirent;
} UNIX_EFI_FILE_PRIVATE;
#define UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS(a) \