From 0bc26da2bfc1cb469e25bdfc6efb9ed9af885d5c Mon Sep 17 00:00:00 2001 From: andrewfish Date: Fri, 17 Jun 2011 21:43:45 +0000 Subject: 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 --- InOsEmuPkg/Unix/Sec/BlockIo.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'InOsEmuPkg/Unix') 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 } -- cgit v1.2.3