X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=Source%2FCTest%2FcmProcess.cxx;h=167b992c9b0e4ab35e8ec41df3466689e36dd327;hb=317dbdb79761ef65e45c7358cfc7571c6afa54ad;hp=000bc8503d46d40828173be506185a432553dc95;hpb=297c63fa65327491a2b50e521b661c5835a19fe4;p=platform%2Fupstream%2Fcmake.git diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 000bc85..167b992 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -175,6 +175,14 @@ int cmProcess::GetNextOutputLine(std::string& line, double timeout) // Record exit information. this->ExitValue = cmsysProcess_GetExitValue(this->Process); this->TotalTime = cmSystemTools::GetTime() - this->StartTime; + // Because of a processor clock scew the runtime may become slightly + // negative. If someone changed the system clock while the process was + // running this may be even more. Make sure not to report a negative + // duration here. + if (this->TotalTime <= 0.0) + { + this->TotalTime = 0.0; + } // std::cerr << "Time to run: " << this->TotalTime << "\n"; return cmsysProcess_Pipe_None; }