diff -u -urN xosview-1.8.1/linux/cpumeter.cc xosview-1.8.1-te/linux/cpumeter.cc --- xosview-1.8.1/linux/cpumeter.cc 2004-12-29 17:41:25.000000000 +0100 +++ xosview-1.8.1-te/linux/cpumeter.cc 2006-12-07 15:32:49.000000000 +0100 @@ -92,17 +92,17 @@ exit( 1 ); } - int line = -1; + int line = 0; std::string buf; - while (!stats.eof()){ - getline(stats, buf); - if (!stats.eof()){ - line++; - if (!strncmp(cpuID, buf.data(), strlen(cpuID)) - && buf[strlen(cpuID)] == ' ') +// while (!stats.eof()){ +// getline(stats, buf); +// if (!stats.eof()){ +// line++; +// if (!strncmp(cpuID, buf.data(), strlen(cpuID)) +// && buf[strlen(cpuID)] == ' ') return line; - } - } +// } +// } return -1; } @@ -118,15 +118,15 @@ exit( 1 ); } - int cpuCount = 0; + int cpuCount = 1; std::string buf; - while (!stats.eof()){ - getline(stats, buf); - if (!stats.eof()){ - if (!strncmp(buf.data(), "cpu", 3) && buf[3] != ' ') - cpuCount++; - } - } +// while (!stats.eof()){ +// getline(stats, buf); +// if (!stats.eof()){ +// if (!strncmp(buf.data(), "cpu", 3) && buf[3] != ' ') +// cpuCount++; +// } +// } return cpuCount; } @@ -135,9 +135,9 @@ static char buffer[32]; std::ostringstream str; - str << "cpu"; - if (num != 0) - str << (num - 1); + str << "cpus"; +// if (num != 0) +// str << (num - 1); str << std::ends; strncpy(buffer, str.str().c_str(), 32);