From: Tor Arne Vestbø Date: Thu, 15 Jun 2017 12:49:28 +0000 (+0200) Subject: Add comment about why SLOPPY_INCLUDE_FILE_[CM]TIME compares using >=t X-Git-Tag: v3.3.5~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf4c4bc053740aa4d9526b1efef65245f9852ed2;p=thirdparty%2Fccache.git Add comment about why SLOPPY_INCLUDE_FILE_[CM]TIME compares using >=t --- diff --git a/ccache.c b/ccache.c index 01e18218d..4d7d8052c 100644 --- a/ccache.c +++ b/ccache.c @@ -560,12 +560,16 @@ remember_include_file(char *path, struct mdfour *cpp_hash, bool system) } } + // The comparison using >= is intentional, due to a possible race + // between starting compilation and writing the include file. + // See https://github.com/ccache/ccache/blob/master/MANUAL.txt if (!(conf->sloppiness & SLOPPY_INCLUDE_FILE_MTIME) && st.st_mtime >= time_of_compilation) { cc_log("Include file %s too new", path); goto failure; } + // The same >= logic as above applies to the change time of the file. if (!(conf->sloppiness & SLOPPY_INCLUDE_FILE_CTIME) && st.st_ctime >= time_of_compilation) { cc_log("Include file %s ctime too new", path);