summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/disk_interface.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/disk_interface.cc b/src/disk_interface.cc
index b418e04..28530b1 100644
--- a/src/disk_interface.cc
+++ b/src/disk_interface.cc
@@ -187,6 +187,11 @@ TimeStamp RealDiskInterface::Stat(const string& path, string* err) const {
*err = "stat(" + path + "): " + strerror(errno);
return -1;
}
+ // Some users (Flatpak) set mtime to 0, this should be harmless
+ // and avoids conflicting with our return value of 0 meaning
+ // that it doesn't exist.
+ if (st.st_mtime == 0)
+ return 1;
return st.st_mtime;
#endif
}