diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-06-01 20:11:38 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-06-01 20:11:38 (GMT) |
commit | 735b77798dfcff8b13c271612b81cf36619d7234 (patch) | |
tree | 0bb23f2239832409de4a45a7dc908f8c00d3176c | |
parent | d0237abfd402a5bc6621828397c09555ba7c4778 (diff) | |
download | CMake-735b77798dfcff8b13c271612b81cf36619d7234.zip CMake-735b77798dfcff8b13c271612b81cf36619d7234.tar.gz CMake-735b77798dfcff8b13c271612b81cf36619d7234.tar.bz2 |
ENH: fix crash on cygwin
-rw-r--r-- | Source/kwsys/SystemInformation.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 94bc22e..f8a37ba 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -2186,7 +2186,6 @@ int SystemInformationImplementation::RetreiveInformationFromCpuInfoFile() // Physical ids returned by Linux don't distinguish cores. // We want to record the total number of cores in this->NumberOfPhysicalCPU // (checking only the first proc) - kwsys_stl::string cores = this->ExtractValueFromCpuInfoFile(buffer,"cpu cores"); int numberOfCoresPerCPU=atoi(cores.c_str()); @@ -2194,8 +2193,11 @@ int SystemInformationImplementation::RetreiveInformationFromCpuInfoFile() #else // __CYGWIN__ // does not have "physical id" entries, neither "cpu cores" - // this has to be fixed for hyper-threading. - this->NumberOfPhysicalCPU=this->NumberOfLogicalCPU; + // this has to be fixed for hyper-threading. + kwsys_stl::string cpucount = + this->ExtractValueFromCpuInfoFile(buffer,"cpu count"); + this->NumberOfPhysicalCPU= + this->NumberOfLogicalCPU = atoi(cpucount.c_str()); #endif // LogicalProcessorsPerPhysical>1 => hyperthreading. |