build fix for Win32 for previous commit (sorry guys)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7143 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
smelenchuk 2011-02-12 02:40:31 +00:00
parent 0d110c41d9
commit 00daea0ec9
1 changed files with 11 additions and 5 deletions

View File

@ -486,13 +486,19 @@ void SaveRecording(const char *filename)
if (success /* && !g_bReadOnly*/)
{
success =
#ifdef WIN32
(g_recordfd = fopen(filename, "r+b")) &&
!(_chsize_s(g_recordfd, size) == 0) &&
fclose(g_recordfd);
int fd;
if (!_sopen_s(&fd, g_recordFile.c_str(), _O_RDWR, _SH_DENYNO, _S_IREAD | _S_IWRITE))
{
success = (_chsize_s(fd, size) == 0);
_close(fd);
}
else
{
success = false;
}
#else
!truncate(filename, size);
success = !truncate(filename, size);
#endif
}