*** empty log message ***

svn path=/trunk/boinc/; revision=4165
This commit is contained in:
David Anderson 2004-09-07 22:31:40 +00:00
parent e3f186a330
commit 4240b90033
2 changed files with 49 additions and 1 deletions

View File

@ -17116,3 +17116,9 @@ David 7 Sept 2004
tools/
upgrade
David 7 Sept 2004
- recognize CPU type on HP (DEC) alpha (from Duane Krahn)
client/
hostinfo_unix.C

View File

@ -217,7 +217,49 @@ void parse_cpuinfo(HOST_INFO& host) {
fclose(f);
}
#else // mips
#elif __alpha__
void parse_cpuinfo(HOST_INFO& host) {
char buf[256];
char buf2[256];
int system_found=0,model_found=0;
strcpy(host.p_vendor, "HP (DEC) ");
FILE* f = fopen("/proc/cpuinfo", "r");
if (!f) return;
while (fgets(buf, 256, f)) {
if ((strstr(buf, "cpu\t\t\t: ") == buf) &&
(system_found == 0)
) {
system_found = 1;
strncpy(buf2, strchr(buf, ':') + 2, sizeof(host.p_vendor) - strlen(host.p_vendor) - 1);
strcat(host.p_vendor, buf2);
char * p = strchr(host.p_vendor, '\n');
if (p) {
*p = '\0';
}
}
if ( (strstr(buf, "cpu model\t\t: ") == buf) &&
(model_found == 0) ) {
model_found = 1;
strncpy(host.p_model, strchr(buf, ':') + 2,
sizeof(host.p_model)-1);
char * p = strchr(host.p_model, '\n');
if (p) {
*p = '\0';
}
}
}
fclose(f);
}
#else // not mips or alpha
// Unfortunately the format of /proc/cpuinfo is not standardized.
// See http://people.nl.linux.org/~hch/cpuinfo/ for some examples.