Skip to content

Commit

Permalink
Merge pull request #1292 from gtristan/work-around-zero-mtime
Browse files Browse the repository at this point in the history
Work around mtime being set to 0 sometimes
  • Loading branch information
nico committed Jun 19, 2017
2 parents 1029064 + b34f744 commit 61e347e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/disk_interface.cc
Expand Up @@ -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
}
Expand Down

0 comments on commit 61e347e

Please sign in to comment.