1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2025-01-31 20:41:45 +01:00

fs: normalize atime (ensure atime >= mtime)

This commit is contained in:
Nekotekina 2018-11-16 14:34:34 +03:00
parent c719ae360d
commit 1fdd013e4b

View File

@ -301,6 +301,9 @@ bool fs::stat(const std::string& path, stat_t& info)
info.ctime = info.mtime;
#endif
if (info.atime < info.mtime)
info.atime = info.mtime;
return true;
}
@ -888,6 +891,9 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
info.mtime = to_time(basic_info.ChangeTime);
info.ctime = info.mtime;
if (info.atime < info.mtime)
info.atime = info.mtime;
return info;
}
@ -1035,6 +1041,9 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
info.mtime = file_info.st_mtime;
info.ctime = info.mtime;
if (info.atime < info.mtime)
info.atime = info.mtime;
return info;
}
@ -1242,6 +1251,9 @@ bool fs::dir::open(const std::string& path)
info.mtime = to_time(found.ftLastWriteTime);
info.ctime = info.mtime;
if (info.atime < info.mtime)
info.atime = info.mtime;
m_entries.emplace_back(std::move(info));
}
@ -1325,6 +1337,9 @@ bool fs::dir::open(const std::string& path)
info.mtime = file_info.st_mtime;
info.ctime = info.mtime;
if (info.atime < info.mtime)
info.atime = info.mtime;
return true;
}