summaryrefslogtreecommitdiff
path: root/InOsEmuPkg/Unix
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-17 21:43:45 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-17 21:43:45 +0000
commit0bc26da2bfc1cb469e25bdfc6efb9ed9af885d5c (patch)
tree3d66367c68cd5dc17dc3eb99832690f5b555027c /InOsEmuPkg/Unix
parent57c7d70ff9bcd4365d75b854046bbb390cb579c6 (diff)
downloadedk2-platforms-0bc26da2bfc1cb469e25bdfc6efb9ed9af885d5c.tar.xz
InOsEmuPkg: Fix Linux compile issues in BlockIo code.
singed-off-by: andrewfish git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11847 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'InOsEmuPkg/Unix')
-rw-r--r--InOsEmuPkg/Unix/Sec/BlockIo.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/InOsEmuPkg/Unix/Sec/BlockIo.c b/InOsEmuPkg/Unix/Sec/BlockIo.c
index 57bfdfa78a..bb2da24d85 100644
--- a/InOsEmuPkg/Unix/Sec/BlockIo.c
+++ b/InOsEmuPkg/Unix/Sec/BlockIo.c
@@ -164,7 +164,11 @@ EmuBlockIoOpenDevice (
Private->Media->LastBlock = Private->NumberOfBlocks - 1;
if (fstatfs (Private->fd, &buf) == 0) {
+#if __APPLE__
Private->Media->OptimalTransferLengthGranularity = buf.f_iosize/buf.f_bsize;
+#else
+ Private->Media->OptimalTransferLengthGranularity = buf.f_bsize/buf.f_bsize;
+#endif
}
}
@@ -518,12 +522,14 @@ EmuBlockIoFlushBlocks (
)
{
EMU_BLOCK_IO_PRIVATE *Private;
- int Res;
Private = EMU_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This);
if (Private->fd >= 0) {
- Res = fcntl (Private->fd, F_FULLFSYNC);
+ fsync (Private->fd);
+#if __APPLE__
+ fcntl (Private->fd, F_FULLFSYNC);
+#endif
}