aboutsummaryrefslogtreecommitdiffstats
path: root/erts/lib_src
diff options
context:
space:
mode:
authorPaul Guyot <[email protected]>2014-10-19 17:21:09 +0200
committerPaul Guyot <[email protected]>2014-10-19 17:21:09 +0200
commitc8ae3f2797d9c613e07b916683c51efea2da81aa (patch)
tree7db1c7c47aa721a41145fbce1e4b79307cc02792 /erts/lib_src
parentf5b344378128831127026b3e18154fdf23d4713c (diff)
downloadotp-c8ae3f2797d9c613e07b916683c51efea2da81aa.tar.gz
otp-c8ae3f2797d9c613e07b916683c51efea2da81aa.tar.bz2
otp-c8ae3f2797d9c613e07b916683c51efea2da81aa.zip
Fix bug in FreeBSD topology detection code
Code incorrectly relied on undefined C behavior. Clang and gcc 4.9 do not behave as code expected. This affected cores and processors detection on FreeBSD.
Diffstat (limited to 'erts/lib_src')
-rw-r--r--erts/lib_src/common/erl_misc_utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/erts/lib_src/common/erl_misc_utils.c b/erts/lib_src/common/erl_misc_utils.c
index d58a28b5cb..7833dd8219 100644
--- a/erts/lib_src/common/erl_misc_utils.c
+++ b/erts/lib_src/common/erl_misc_utils.c
@@ -1515,7 +1515,7 @@ const char* parse_topology_spec_group(erts_cpu_info_t *cpuinfo, const char* xml,
if (is_thread_group) {
thread++;
} else {
- *core_p = (*core_p)++;
+ *core_p = (*core_p) + 1;
}
index_procs++;
}
@@ -1535,9 +1535,9 @@ const char* parse_topology_spec_group(erts_cpu_info_t *cpuinfo, const char* xml,
if (parentCacheLevel == 0) {
*core_p = 0;
- *processor_p = (*processor_p)++;
+ *processor_p = (*processor_p) + 1;
} else {
- *core_p = (*core_p)++;
+ *core_p = (*core_p) + 1;
}
if (error)