mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
[linux] Fix zero file creation (birth) time
Observed in Ubuntu 24 via Orb on arm-based Mac Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
committed by
Konstantin Pastbin
parent
fbaa59ce3b
commit
674abcf02e
@@ -232,6 +232,9 @@ time_t Platform::GetFileCreationTime(std::string const & path)
|
||||
struct stat st;
|
||||
if (0 == stat(path.c_str(), &st))
|
||||
return st.st_atim.tv_sec;
|
||||
|
||||
LOG(LERROR, ("GetFileCreationTime stat failed for", path, "with error", strerror(errno)));
|
||||
// TODO(AB): Refactor to return std::optional<time_t>.
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -241,5 +244,8 @@ time_t Platform::GetFileModificationTime(std::string const & path)
|
||||
struct stat st;
|
||||
if (0 == stat(path.c_str(), &st))
|
||||
return st.st_mtim.tv_sec;
|
||||
|
||||
LOG(LERROR, ("GetFileModificationTime stat failed for", path, "with error", strerror(errno)));
|
||||
// TODO(AB): Refactor to return std::optional<time_t>.
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user