Prechádzať zdrojové kódy

ENH: fix crash on cygwin

Bill Hoffman 17 rokov pred
rodič
commit
735b77798d
1 zmenil súbory, kde vykonal 5 pridanie a 3 odobranie
  1. 5 3
      Source/kwsys/SystemInformation.cxx

+ 5 - 3
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.