|
|
@ -117,7 +117,7 @@ bool FileCommit(FILE* file)
|
|
|
|
LogPrintf("FlushFileBuffers failed: %s\n", Win32ErrorString(GetLastError()));
|
|
|
|
LogPrintf("FlushFileBuffers failed: %s\n", Win32ErrorString(GetLastError()));
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#elif defined(MAC_OSX) && defined(F_FULLFSYNC)
|
|
|
|
#elif defined(__APPLE__) && defined(F_FULLFSYNC)
|
|
|
|
if (fcntl(fileno(file), F_FULLFSYNC, 0) == -1) { // Manpage says "value other than -1" is returned on success
|
|
|
|
if (fcntl(fileno(file), F_FULLFSYNC, 0) == -1) { // Manpage says "value other than -1" is returned on success
|
|
|
|
LogPrintf("fcntl F_FULLFSYNC failed: %s\n", SysErrorString(errno));
|
|
|
|
LogPrintf("fcntl F_FULLFSYNC failed: %s\n", SysErrorString(errno));
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -195,7 +195,7 @@ void AllocateFileRange(FILE* file, unsigned int offset, unsigned int length)
|
|
|
|
nFileSize.u.HighPart = nEndPos >> 32;
|
|
|
|
nFileSize.u.HighPart = nEndPos >> 32;
|
|
|
|
SetFilePointerEx(hFile, nFileSize, 0, FILE_BEGIN);
|
|
|
|
SetFilePointerEx(hFile, nFileSize, 0, FILE_BEGIN);
|
|
|
|
SetEndOfFile(hFile);
|
|
|
|
SetEndOfFile(hFile);
|
|
|
|
#elif defined(MAC_OSX)
|
|
|
|
#elif defined(__APPLE__)
|
|
|
|
// OSX specific version
|
|
|
|
// OSX specific version
|
|
|
|
// NOTE: Contrary to other OS versions, the OSX version assumes that
|
|
|
|
// NOTE: Contrary to other OS versions, the OSX version assumes that
|
|
|
|
// NOTE: offset is the size of the file.
|
|
|
|
// NOTE: offset is the size of the file.
|
|
|
|