summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestRunTest.cxx
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2010-03-18 18:48:42 (GMT)
committerZach Mullen <zach.mullen@kitware.com>2010-03-18 18:48:42 (GMT)
commit9eea95c90f62c2d2299938400ba07ea23c0a834d (patch)
tree324d2b78a62be7d0138698c9a7bffd039d1ed3a0 /Source/CTest/cmCTestRunTest.cxx
parent9676c52c3ea26dcd74bdffd14fa91869c00354f7 (diff)
downloadCMake-9eea95c90f62c2d2299938400ba07ea23c0a834d.zip
CMake-9eea95c90f62c2d2299938400ba07ea23c0a834d.tar.gz
CMake-9eea95c90f62c2d2299938400ba07ea23c0a834d.tar.bz2
Fix StopTime to also account for localtime being a day ahead of gmtime
Diffstat (limited to 'Source/CTest/cmCTestRunTest.cxx')
-rw-r--r--Source/CTest/cmCTestRunTest.cxx9
1 files changed, 5 insertions, 4 deletions
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;