diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-06-02 03:40:30 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-06-02 03:40:30 (GMT) |
commit | 2f082668bd9f74044b94f395149f7561b29c7867 (patch) | |
tree | 9c7a675681b54b52a95fd800dea3457849e1b746 /Source/kwsys/SystemInformation.cxx | |
parent | 735b77798dfcff8b13c271612b81cf36619d7234 (diff) | |
download | CMake-2f082668bd9f74044b94f395149f7561b29c7867.zip CMake-2f082668bd9f74044b94f395149f7561b29c7867.tar.gz CMake-2f082668bd9f74044b94f395149f7561b29c7867.tar.bz2 |
ENH: fix crash on dash17 linux where the parsing of the proc file must not have worked right
Diffstat (limited to 'Source/kwsys/SystemInformation.cxx')
-rw-r--r-- | Source/kwsys/SystemInformation.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index f8a37ba..373f959 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -2199,7 +2199,12 @@ int SystemInformationImplementation::RetreiveInformationFromCpuInfoFile() this->NumberOfPhysicalCPU= this->NumberOfLogicalCPU = atoi(cpucount.c_str()); #endif - + // gotta have one, and if this is 0 then we get a / by 0n + // beter to have a bad answer than a crash + if(this->NumberOfPhysicalCPU <= 0) + { + this->NumberOfPhysicalCPU = 1; + } // LogicalProcessorsPerPhysical>1 => hyperthreading. this->Features.ExtendedFeatures.LogicalProcessorsPerPhysical= this->NumberOfLogicalCPU/this->NumberOfPhysicalCPU; |