Merge pull request #1111 from bradking/detect-cycles-early
Detect build graph cycles as early as possible
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 @@
*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
}