29 lines
848 B
Diff
29 lines
848 B
Diff
From b34f744ac3c8276a854b134d41c28d84664c7e7f Mon Sep 17 00:00:00 2001
|
|
From: Patrick Griffis <tingping@tingping.se>
|
|
Date: Mon, 20 Mar 2017 21:46:42 -0400
|
|
Subject: [PATCH] Work around mtime being set to 0 sometimes
|
|
|
|
---
|
|
src/disk_interface.cc | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
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
|
|
}
|
|
--
|
|
2.13.0
|
|
|