audk/MdePkg
Laszlo Ersek 5dbc768f1c MdePkg/UefiLib: don't special-case EFI_FILE_MODE_CREATE in OpenMode
While reviewing the patch that would land as 768b611136
("MdePkg/UefiLib: introduce EfiOpenFileByDevicePath()", 2018-08-16), Ray
pointed out that distinguishing EFI_FILE_MODE_CREATE was wasteful. Per
spec, if the file to create exists, then EFI_FILE_MODE_CREATE is ignored
by EFI_FILE_PROTOCOL.Open(), and the existent file is opened.

Therefore we don't need an attempt to "open-but-not-create" first, and a
fallback to "open-and-create-too" second -- that behavior is internal to
EFI_FILE_PROTOCOL.Open(). Remove the special-casing of
EFI_FILE_MODE_CREATE.

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>
2018-08-22 10:31:47 +02:00
..
Include MdePkg/UefiLib: don't special-case EFI_FILE_MODE_CREATE in OpenMode 2018-08-22 10:31:47 +02:00
Library MdePkg/UefiLib: don't special-case EFI_FILE_MODE_CREATE in OpenMode 2018-08-22 10:31:47 +02:00
MdePkg.dec MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
MdePkg.dsc MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
MdePkg.uni MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
MdePkgExtra.uni MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00