mirror of https://github.com/BOINC/boinc.git
client: parse ARM CPU model
Apparently the format of /proc/cpuinfo has changed on some ARM Linuxes, e.g. Raspbian Wheezy. The CPU model is something like: model name : ARMv7 Processor rev 5 (v7l) and the chars between "name" and ":" can be either spaces or a tab.
This commit is contained in:
parent
979a761b1d
commit
629fabffb6
|
@ -513,7 +513,7 @@ static void parse_cpuinfo_linux(HOST_INFO& host) {
|
||||||
#elif __powerpc__ || __sparc__
|
#elif __powerpc__ || __sparc__
|
||||||
strstr(buf, "cpu\t\t: ")
|
strstr(buf, "cpu\t\t: ")
|
||||||
#elif __arm__
|
#elif __arm__
|
||||||
strstr(buf, "Processor\t: ")
|
strstr(buf, "Processor\t: ") || strstr(buf, "model name")
|
||||||
#else
|
#else
|
||||||
strstr(buf, "model name\t: ") || strstr(buf, "cpu model\t\t: ")
|
strstr(buf, "model name\t: ") || strstr(buf, "cpu model\t\t: ")
|
||||||
#endif
|
#endif
|
||||||
|
@ -542,7 +542,8 @@ static void parse_cpuinfo_linux(HOST_INFO& host) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
model_found = true;
|
model_found = true;
|
||||||
strlcpy(buf2, strchr(buf, ':') + 2, sizeof(host.p_model) - strlen(host.p_model) - 1);
|
strlcpy(buf2, strchr(buf, ':') + 1, sizeof(host.p_model) - strlen(host.p_model) - 1);
|
||||||
|
strip_whitespace(buf2);
|
||||||
strcat(host.p_model, buf2);
|
strcat(host.p_model, buf2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue