summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemInformation.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-06-01 20:11:38 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-06-01 20:11:38 (GMT)
commit735b77798dfcff8b13c271612b81cf36619d7234 (patch)
tree0bb23f2239832409de4a45a7dc908f8c00d3176c /Source/kwsys/SystemInformation.cxx
parentd0237abfd402a5bc6621828397c09555ba7c4778 (diff)
downloadCMake-735b77798dfcff8b13c271612b81cf36619d7234.zip
CMake-735b77798dfcff8b13c271612b81cf36619d7234.tar.gz
CMake-735b77798dfcff8b13c271612b81cf36619d7234.tar.bz2
ENH: fix crash on cygwin
Diffstat (limited to 'Source/kwsys/SystemInformation.cxx')
-rw-r--r--Source/kwsys/SystemInformation.cxx8
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.