[Cmake-commits] CMake branch, master, updated. 9eea95c90f62c2d2299938400ba07ea23c0a834d

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Mar 18 14:48:53 EDT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  9eea95c90f62c2d2299938400ba07ea23c0a834d (commit)
      from  9676c52c3ea26dcd74bdffd14fa91869c00354f7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9eea95c90f62c2d2299938400ba07ea23c0a834d
commit 9eea95c90f62c2d2299938400ba07ea23c0a834d
Author: Zach Mullen <zach.mullen at kitware.com>
Date:   Thu Mar 18 14:48:42 2010 -0400

    Fix StopTime to also account for localtime being a day ahead of gmtime

diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index adabbc2..13b20de 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -535,15 +535,16 @@ double cmCTestRunTest::ResolveTimeout()
   lctime = localtime(&current_time);
   int local_hour = lctime->tm_hour;
 
-  int tzone_offset = 0;
+  int tzone_offset = local_hour - gm_hour;
   if(gm_time > current_time && gm_hour < local_hour)
     {
     // this means gm_time is on the next day
-    tzone_offset = local_hour - gm_hour - 24;
+    tzone_offset -= 24;
     }
-  else
+  else if(gm_time < current_time && gm_hour > local_hour)
     {
-    tzone_offset = local_hour - gm_hour;
+    // this means gm_time is on the previous day
+    tzone_offset += 24;
     }
 
   tzone_offset *= 100;
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 098bd7a..9ab881c 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -2561,15 +2561,16 @@ void cmCTest::DetermineNextDayStop()
   lctime = localtime(&current_time);
   int local_hour = lctime->tm_hour;
 
-  int tzone_offset = 0;
+  int tzone_offset = local_hour - gm_hour;
   if(gm_time > current_time && gm_hour < local_hour)
     {
     // this means gm_time is on the next day
-    tzone_offset = local_hour - gm_hour - 24;
+    tzone_offset -= 24;
     }
-  else
+  else if(gm_time < current_time && gm_hour > local_hour)
     {
-    tzone_offset = local_hour - gm_hour;
+    // this means gm_time is on the previous day
+    tzone_offset += 24;
     }
 
   tzone_offset *= 100;

-----------------------------------------------------------------------

Summary of changes:
 Source/CTest/cmCTestRunTest.cxx |    9 +++++----
 Source/cmCTest.cxx              |    9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list