all repos — mgba @ eb6cedde2e11184c560dc69717891d0c00c96452

mGBA Game Boy Advance Emulator

VFS: VFile.sync now updates modified time
Jeffrey Pfau jeffrey@endrift.com
Wed, 15 Jun 2016 22:46:24 -0700
commit

eb6cedde2e11184c560dc69717891d0c00c96452

parent

6b1cbbd5e2f08c52a5f22ac6a71c3b2caba523d1

2 files changed, 10 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -49,6 +49,7 @@ - OpenGL: Add texSize uniform

- Qt: Add refresh button to controller editing - ARM7: Clean up instruction decoding for future expandability - Debugger: CLI debugger now exits when end-of-stream is reached + - VFS: VFile.sync now updates modified time 0.4.0: (2016-02-02) Features:
M src/util/vfs/vfs-fd.csrc/util/vfs/vfs-fd.c

@@ -9,6 +9,7 @@ #include <fcntl.h>

#include <sys/stat.h> #ifndef _WIN32 #include <sys/mman.h> +#include <sys/time.h> #else #include <windows.h> #endif

@@ -159,8 +160,15 @@ UNUSED(buffer);

UNUSED(size); struct VFileFD* vfd = (struct VFileFD*) vf; #ifndef _WIN32 + futimes(vfd->fd, NULL); return fsync(vfd->fd) == 0; #else - return FlushFileBuffers((HANDLE) _get_osfhandle(vfd->fd)); + HANDLE h = (HANDLE) _get_osfhandle(vfd->fd); + FILETIME ft; + SYSTEMTIME st; + GetSystemTime(&st); + SystemTimeToFileTime(&st, &ft); + SetFileTime(h, NULL, &ft, &ft); + return FlushFileBuffers(h); #endif }