summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2009-12-31 20:59:51 +0000
committerSteve Huston <shuston@riverace.com>2009-12-31 20:59:51 +0000
commit32a1e2776eda945af87899b9a264a6a1c9c8180d (patch)
tree64d1582ac7d4467f8b09c1501a5fffc45ff1368a
parentaa0593151dd1b8ed001360ad09190fb100772c06 (diff)
downloadATCD-32a1e2776eda945af87899b9a264a6a1c9c8180d.tar.gz
ChangeLogTag:Thu Dec 31 20:54:51 UTC 2009 Steve Huston <shuston@riverace.com>
-rw-r--r--ChangeLog5
-rw-r--r--ace/High_Res_Timer.cpp9
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 728d445b600..5acecac2ba7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Dec 31 20:54:51 UTC 2009 Steve Huston <shuston@riverace.com>
+
+ * ace/High_Res_Timer.cpp (get_cpuinfo): Don't use a CPU MHz value 0.
+ I got a customer report with a real cpuinfo file showing 0.
+
Thu Dec 31 17:46:10 UTC 2009 Steve Huston <shuston@riverace.com>
* bin/MakeProjectCreator/config/ace_fl.mpb: Rather than add
diff --git a/ace/High_Res_Timer.cpp b/ace/High_Res_Timer.cpp
index ce787c02129..69099214051 100644
--- a/ace/High_Res_Timer.cpp
+++ b/ace/High_Res_Timer.cpp
@@ -152,9 +152,12 @@ ACE_High_Res_Timer::get_cpuinfo (void)
{
// If the line "cpu MHz : xxx" is present, then it's a
// reliable measure of the CPU speed - according to the
- // kernel-source.
- scale_factor = (ACE_UINT32) (mhertz + 0.5);
- break;
+ // kernel-source. It's possible to see a 0 value reported.
+ if (mhertz > 0.0)
+ {
+ scale_factor = (ACE_UINT32) (mhertz + 0.5);
+ break;
+ }
}
else if (::sscanf (buf, "bogomips : %lf\n", &bmips) == 1
|| ::sscanf (buf, "BogoMIPS : %lf\n", &bmips) == 1)