diff options
author | Paul Guyot <[email protected]> | 2014-10-19 17:21:09 +0200 |
---|---|---|
committer | Paul Guyot <[email protected]> | 2014-10-19 17:21:09 +0200 |
commit | c8ae3f2797d9c613e07b916683c51efea2da81aa (patch) | |
tree | 7db1c7c47aa721a41145fbce1e4b79307cc02792 | |
parent | f5b344378128831127026b3e18154fdf23d4713c (diff) | |
download | otp-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.
-rw-r--r-- | erts/lib_src/common/erl_misc_utils.c | 6 |
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) |