Implemented changing file time. Cleaned up tabs in LocalFile::Close

This commit is contained in:
Jochen Sch„fer 2025-04-01 08:09:30 +02:00
parent 59a285f217
commit d6f2be9be6

View File

@ -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!