diff options
author | Jose <jose@zeroc.com> | 2013-08-01 00:00:38 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2013-08-01 00:00:38 +0200 |
commit | 56e7982824c99e231d28f6c34cca71ff9b7a4caa (patch) | |
tree | b95f1db8d8b4905524499c6491e7bd82f5f2e525 /cpp/src | |
parent | Fixed ICE-5395 - invalid code generated with ["cpp:virtual"] (diff) | |
download | ice-56e7982824c99e231d28f6c34cca71ff9b7a4caa.tar.bz2 ice-56e7982824c99e231d28f6c34cca71ff9b7a4caa.tar.xz ice-56e7982824c99e231d28f6c34cca71ff9b7a4caa.zip |
Fixed (ICE-4665) - node processors returns 0
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IceGrid/PlatformInfo.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cpp/src/IceGrid/PlatformInfo.cpp b/cpp/src/IceGrid/PlatformInfo.cpp index 12e237093ce..d844a7f4a75 100644 --- a/cpp/src/IceGrid/PlatformInfo.cpp +++ b/cpp/src/IceGrid/PlatformInfo.cpp @@ -292,16 +292,23 @@ PlatformInfo::PlatformInfo(const string& prefix, #elif defined(__linux) IceUtilInternal::ifstream is(string("/proc/cpuinfo")); set<string> ids; + + int nprocessor = 0; while(is) { string line; getline(is, line); - if(line.find("physical id") == 0) + if(line.find("processor") == 0) + { + nprocessor++; + } + else if(line.find("physical id") == 0) { + nprocessor--; ids.insert(line); } } - _nProcessorSockets = ids.size(); + _nProcessorSockets = nprocessor + ids.size(); #else // Not supported _nProcessorSockets = 1; |