mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-05-09 03:41:10 +08:00
Implemented changing file time. Cleaned up tabs in LocalFile::Close
This commit is contained in:
parent
59a285f217
commit
d6f2be9be6
@ -36,6 +36,9 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/utime.h>
|
||||
#include <sys/locking.h>
|
||||
#ifdef OS2
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
|
||||
@ -2996,7 +2999,13 @@ bool LocalFile::Close() {
|
||||
LOG_MSG("Set time failed (%s)", strerror(errno));
|
||||
}
|
||||
#elif defined(OS2)
|
||||
LOG_MSG("File set time TBD");
|
||||
struct timeval ftsp[2];
|
||||
ftsp[0].tv_sec = ftsp[1].tv_sec = mktime(&tim);
|
||||
ftsp[0].tv_usec = ftsp[1].tv_usec = 0;
|
||||
if (futimes(fileno(fhandle), ftsp)) {
|
||||
extern int errno;
|
||||
LOG_MSG("Set time failed (%s)", strerror(errno));
|
||||
}
|
||||
#elif !defined(RISCOS) // Linux (TODO: What about Mac OS X/Darwin?)
|
||||
// NTS: Do not attempt futime, Linux doesn't have it.
|
||||
// Do not attempt futimes, Linux man pages LIE about having it. It's even there in the freaking header, but not recognized!
|
||||
|
Loading…
x
Reference in New Issue
Block a user