From aec320b76ce18f022ce683f99b9fc759f66f46c5 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Mon, 25 Jun 2012 09:14:27 +0800 Subject: [PATCH] darwin: get cpu model correctly on mac --- src/unix/darwin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unix/darwin.c b/src/unix/darwin.c index e6deb301..cb45db03 100644 --- a/src/unix/darwin.c +++ b/src/unix/darwin.c @@ -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);