summaryrefslogtreecommitdiffstats
path: root/IntelFrameworkPkg
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2018-08-17 15:06:35 +0200
committerLaszlo Ersek <lersek@redhat.com>2018-08-22 10:32:24 +0200
commitd00759b212e7912113d9c3292c0174c6dbf74842 (patch)
tree9325e2a46822cd8e69bec541203b1a5a71c9026a /IntelFrameworkPkg
parent5dbc768f1cd988b87932ba2f176caa006064018d (diff)
downloadedk2-d00759b212e7912113d9c3292c0174c6dbf74842.tar.gz
edk2-d00759b212e7912113d9c3292c0174c6dbf74842.tar.bz2
edk2-d00759b212e7912113d9c3292c0174c6dbf74842.zip
IntelFrameworkPkg/FrameworkUefiLib: don't special-case EFI_FILE_MODE_CREATE
Synchronize EfiOpenFileByDevicePath() with the MdePkg/UefiLib instance, as described in the previous patch. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Suggested-by: Ruiyu Ni <ruiyu.ni@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1074 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'IntelFrameworkPkg')
-rw-r--r--IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c40
1 files changed, 6 insertions, 34 deletions
diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
index b283d775b4..45bf4b17c5 100644
--- a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
+++ b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
@@ -1702,12 +1702,7 @@ EfiLocateProtocolBuffer (
On the remaining device path, the longest initial sequence of
FILEPATH_DEVICE_PATH nodes is node-wise traversed with
- EFI_FILE_PROTOCOL.Open(). For the pathname fragment specified by each
- traversed FILEPATH_DEVICE_PATH node, EfiOpenFileByDevicePath() first masks
- EFI_FILE_MODE_CREATE out of OpenMode, and passes 0 for Attributes. If
- EFI_FILE_PROTOCOL.Open() fails, and OpenMode includes EFI_FILE_MODE_CREATE,
- then the operation is retried with the caller's OpenMode and Attributes
- unmodified.
+ EFI_FILE_PROTOCOL.Open().
(As a consequence, if OpenMode includes EFI_FILE_MODE_CREATE, and Attributes
includes EFI_FILE_DIRECTORY, and each FILEPATH_DEVICE_PATH specifies a single
@@ -1739,18 +1734,10 @@ EfiLocateProtocolBuffer (
the last node in FilePath.
@param[in] OpenMode The OpenMode parameter to pass to
- EFI_FILE_PROTOCOL.Open(). For each
- FILEPATH_DEVICE_PATH node in FilePath,
- EfiOpenFileByDevicePath() first opens the specified
- pathname fragment with EFI_FILE_MODE_CREATE masked
- out of OpenMode and with Attributes set to 0, and
- only retries the operation with EFI_FILE_MODE_CREATE
- unmasked and Attributes propagated if the first open
- attempt fails.
+ EFI_FILE_PROTOCOL.Open().
@param[in] Attributes The Attributes parameter to pass to
- EFI_FILE_PROTOCOL.Open(), when EFI_FILE_MODE_CREATE
- is propagated unmasked in OpenMode.
+ EFI_FILE_PROTOCOL.Open().
@retval EFI_SUCCESS The file or directory has been opened or
created.
@@ -1861,32 +1848,17 @@ EfiOpenFileByDevicePath (
}
//
- // Open the next pathname fragment with EFI_FILE_MODE_CREATE masked out and
- // with Attributes set to 0.
+ // Open or create the file corresponding to the next pathname fragment.
//
Status = LastFile->Open (
LastFile,
&NextFile,
PathName,
- OpenMode & ~(UINT64)EFI_FILE_MODE_CREATE,
- 0
+ OpenMode,
+ Attributes
);
//
- // Retry with EFI_FILE_MODE_CREATE and the original Attributes if the first
- // attempt failed, and the caller specified EFI_FILE_MODE_CREATE.
- //
- if (EFI_ERROR (Status) && (OpenMode & EFI_FILE_MODE_CREATE) != 0) {
- Status = LastFile->Open (
- LastFile,
- &NextFile,
- PathName,
- OpenMode,
- Attributes
- );
- }
-
- //
// Release any AlignedPathName on both error and success paths; PathName is
// no longer needed.
//