Fix building on Linux as '__time64_t' isn't portable

This commit is contained in:
Campbell Barton 2020-03-19 11:50:46 +11:00
parent f70241deba
commit f3e7c1e8c8
1 changed files with 4 additions and 9 deletions

View File

@ -262,17 +262,12 @@ static void seq_disk_cache_get_files(SeqDiskCache *disk_cache, char *path)
static DiskCacheFile *seq_disk_cache_get_oldest_file(SeqDiskCache *disk_cache)
{
DiskCacheFile *cache_file = disk_cache->files.first;
if (!cache_file) {
DiskCacheFile *oldest_file = disk_cache->files.first;
if (oldest_file == NULL) {
return NULL;
}
DiskCacheFile *oldest_file = cache_file;
__time64_t oldest_timestamp = cache_file->fstat.st_mtime;
for (; cache_file; cache_file = cache_file->next) {
if (cache_file->fstat.st_mtime < oldest_timestamp) {
oldest_timestamp = cache_file->fstat.st_mtime;
for (DiskCacheFile *cache_file = oldest_file->next; cache_file; cache_file = cache_file->next) {
if (cache_file->fstat.st_mtime < oldest_file->fstat.st_mtime) {
oldest_file = cache_file;
}
}