Windows: do not update file timestamp with invalid value

This commit is contained in:
rakslice
2025-01-30 02:10:56 -08:00
parent d80663fe37
commit f43d2193f1

View File

@@ -1135,6 +1135,11 @@ int my_write( int fd, const void *buffer, unsigned int count )
static FILETIME get_file_time(time_t time) {
FILETIME ft;
if (time == -1) {
ft.dwHighDateTime = 0;
ft.dwLowDateTime = 0;
return ft;
}
unsigned long long result = 11644473600LL;
result += time;
result *= 10000000LL;