mirror of https://github.com/mgba-emu/mgba.git
VFS: VFile.sync now updates modified time
This commit is contained in:
parent
6b1cbbd5e2
commit
eb6cedde2e
1
CHANGES
1
CHANGES
|
@ -49,6 +49,7 @@ Misc:
|
|||
- 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:
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <sys/stat.h>
|
||||
#ifndef _WIN32
|
||||
#include <sys/mman.h>
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
@ -159,8 +160,15 @@ static bool _vfdSync(struct VFile* vf, const void* buffer, size_t size) {
|
|||
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue