diff options
Diffstat (limited to 'InOsEmuPkg/Unix/Sec/SecMain.c')
-rw-r--r-- | InOsEmuPkg/Unix/Sec/SecMain.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/InOsEmuPkg/Unix/Sec/SecMain.c b/InOsEmuPkg/Unix/Sec/SecMain.c index ff5eff0c07..41b66b3bc0 100644 --- a/InOsEmuPkg/Unix/Sec/SecMain.c +++ b/InOsEmuPkg/Unix/Sec/SecMain.c @@ -354,18 +354,19 @@ MapFile ( VOID *res; UINTN FileSize; - fd = open (FileName, O_RDONLY); + fd = open (FileName, O_RDWR); if (fd < 0) { return EFI_NOT_FOUND; } FileSize = lseek (fd, 0, SEEK_END); - res = MapMemory (fd, FileSize, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE); + res = MapMemory (fd, FileSize, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED); close (fd); - if (res == MAP_FAILED) { + if (res == NULL) { + perror ("MapFile() Failed"); return EFI_DEVICE_ERROR; } |