From e4c4d8d65ea675eaa56c85661ba42e112ab70f4b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Nov 2018 12:08:36 +0200 Subject: Improve workaround for backwards modification time issue --- build2/cc/link-rule.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'build2/cc/link-rule.cxx') diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx index c4fd82b..981358e 100644 --- a/build2/cc/link-rule.cxx +++ b/build2/cc/link-rule.cxx @@ -2071,12 +2071,12 @@ namespace build2 if (dd.writing () || dd.mtime > mt) scratch = update = true; -#define MTIME_SANITY_CHECK -#ifdef MTIME_SANITY_CHECK +#define BUILD2_MTIME_CHECK +#ifdef BUILD2_MTIME_CHECK timestamp dd_tt (system_clock::now ()); #endif - timestamp dd_ct (dd.close ()); + dd.close (); // If nothing changed, then we are done. // @@ -2560,7 +2560,7 @@ namespace build2 rm.cancel (); -#ifdef MTIME_SANITY_CHECK +#ifdef BUILD2_MTIME_CHECK { timestamp tp_mt (file_mtime (tp)); timestamp dd_mt (file_mtime (dd.path)); @@ -2568,11 +2568,11 @@ namespace build2 if (dd_mt > tp_mt) fail << "backwards modification times:\n" - << dd_tt << " window start\n" - << dd_ct << " close mtime\n" - << dd_mt << " " << dd.path.string () << '\n' - << tp_mt << " " << tp.string () << '\n' - << tp_tt << " window end"; + << dd_tt << " window start\n" + << dd.mtime << " close mtime\n" + << dd_mt << " " << dd.path.string () << '\n' + << tp_mt << " " << tp.string () << '\n' + << tp_tt << " window end"; } #endif -- cgit v1.1