diff options
Diffstat (limited to 'BaseTools/Source/C/GnuGenBootSector')
-rw-r--r-- | BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c b/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c index 8a0952ff08..267eaa332c 100644 --- a/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c +++ b/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c @@ -235,10 +235,13 @@ ProcessBsOrMbr ( }
//Process Floppy Disk
- OutputFile = fopen(OutputInfo->PhysicalPath, "w");
+ OutputFile = fopen(OutputInfo->PhysicalPath, "r+");
if (OutputFile == NULL) {
- return ErrorFileReadWrite;
- }
+ OutputFile = fopen(OutputInfo->PhysicalPath, "w");
+ if (OutputFile == NULL) {
+ return ErrorFileReadWrite;
+ }
+ }
if (OutputInfo->Type != PathFile) {
if (ProcessMbr) {
|