From cf4c4bc053740aa4d9526b1efef65245f9852ed2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 15 Jun 2017 14:49:28 +0200 Subject: [PATCH] Add comment about why SLOPPY_INCLUDE_FILE_[CM]TIME compares using >=t --- ccache.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.47.2