diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-11-23 15:45:58 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-11-23 15:45:58 +0200 |
commit | 004049afd50ef60860ea0d0da6f5742d66f0ac30 (patch) | |
tree | be1c797b38741a6d0dbd827c9400f61d72b3a276 | |
parent | f9121ebda0d11e28c4fa19401ac9f5dc43e6dca5 (diff) |
More backwards modification time experimentation
-rw-r--r-- | build2/depdb.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/build2/depdb.cxx b/build2/depdb.cxx index aec2562..6f906c2 100644 --- a/build2/depdb.cxx +++ b/build2/depdb.cxx @@ -286,6 +286,7 @@ namespace build2 start_ = system_clock::now (); #endif + /* #ifdef _WIN32 // // On Windows there are two times, the precise time (which is what we @@ -300,6 +301,7 @@ namespace build2 wtime_ = mt; // Save for check below. #endif #endif + */ fs_.put ('\0'); // The "end marker". } @@ -310,6 +312,19 @@ namespace build2 if (state_ == state::write) { #ifdef _WIN32 + // + // On Windows there are two times, the precise time (which is what we + // get with system_clock::now()) and what we will call "filesystem time" + // which can lag the precise time by as much as couple of milliseconds. + // + FILETIME ft; + GetSystemTimeAsFileTime (&ft); + mt = to_timestamp (ft); + +#ifdef BUILD2_MTIME_CHECK + wtime_ = mt; // Save for check below. +#endif + auto file_mtime_h = [&to_timestamp] (const path_type& p) -> timestamp { HANDLE h (CreateFile (p.string ().c_str (), |