diff options
author | elupus <elupus@svn> | 2010-07-25 12:26:10 +0000 |
---|---|---|
committer | elupus <elupus@svn> | 2010-07-25 12:26:10 +0000 |
commit | c28d2253a58c18f2056c9e01d013b11ea21a88a7 (patch) | |
tree | ef83cf140c9728d5df3c2a8769ff937ee1f83236 | |
parent | 3f520c889c5d34c5908055f872e785e7028788df (diff) |
fixed: python never reused pyo objects on windows due to fstat64i32 never setting mtime correctly
changed: emulate fstat32 aswell
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@32159 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r-- | xbmc/cores/DllLoader/Win32DllLoader.cpp | 2 | ||||
-rw-r--r-- | xbmc/cores/DllLoader/exports/emu_msvcrt.cpp | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/xbmc/cores/DllLoader/Win32DllLoader.cpp b/xbmc/cores/DllLoader/Win32DllLoader.cpp index 89f919e5b4..2a163d8182 100644 --- a/xbmc/cores/DllLoader/Win32DllLoader.cpp +++ b/xbmc/cores/DllLoader/Win32DllLoader.cpp @@ -77,6 +77,8 @@ Export win32_exports[] = { "_fstat", -1, (void*)dll_fstat, NULL }, { "_mkdir", -1, (void*)dll_mkdir, NULL }, { "_stat", -1, (void*)dll_stat, NULL }, + { "_fstat32", -1, (void*)dll_fstat, NULL }, + { "_stat32", -1, (void*)dll_stat, NULL }, { "_findclose", -1, (void*)dll_findclose, NULL }, { "_findfirst", -1, (void*)dll_findfirst, NULL }, { "_findnext", -1, (void*)dll_findnext, NULL }, diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp index 1da0896178..6897b311ac 100644 --- a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp +++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp @@ -1820,15 +1820,13 @@ extern "C" CFile* pFile = g_emuFileWrapper.GetFileXbmcByDescriptor(fd); if (pFile != NULL) { - if (pFile->GetLength() <= LONG_MAX) - buffer->st_size = (_off_t)pFile->GetLength(); - else + struct __stat64 tStat = {}; + if (pFile->Stat(&tStat) == 0) { - buffer->st_size = 0; - CLog::Log(LOGWARNING, "WARNING: File is larger than _fstat64i32 can handle, file size will be reported as 0 bytes"); + CUtil::Stat64ToStat64i32(buffer, &tStat); + return 0; } - buffer->st_mode = _S_IFREG; - return 0; + return -1; } else if (!IS_STD_DESCRIPTOR(fd)) { |