Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
darwin: get cpu model correctly on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
upsuper authored and bnoordhuis committed Jun 25, 2012
1 parent 0005b52 commit aec320b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/unix/darwin.c
Expand Up @@ -211,7 +211,8 @@ uv_err_t uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
uv_cpu_info_t* cpu_info;

size = sizeof(model);
if (sysctlbyname("hw.model", &model, &size, NULL, 0) < 0) {
if (sysctlbyname("machdep.cpu.brand_string", &model, &size, NULL, 0) < 0 &&
sysctlbyname("hw.model", &model, &size, NULL, 0) < 0) {
return uv__new_sys_error(errno);
}
size = sizeof(cpuspeed);
Expand Down

0 comments on commit aec320b

Please sign in to comment.