diff --git a/AUTHORS b/AUTHORS index 42b5c6a9..3482e94f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -139,6 +139,9 @@ Roman Bogorodskiy Szymon Boniecki Reads current LC_TIME +Thomas Cort + CPU frequency patch for alpha + Toni exec*/tail/head output evalution diff --git a/ChangeLog b/ChangeLog index 148efd57..55c8b8b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ # $Id$ +2006-03-05 + * Added patch to make $cpu stuff work on alpha (thanks Thomas Cort) + http://bugs.gentoo.org/show_bug.cgi?id=122637#c3 + 2006-02-14 * Drastically simplified own_window=yes window creation code. * on_bottom and wm_class_name deprecated (they do nothing) diff --git a/src/linux.c b/src/linux.c index cc54dcd4..d234da98 100644 --- a/src/linux.c +++ b/src/linux.c @@ -860,12 +860,22 @@ void get_freq( char * p_client_buffer, size_t client_buffer_size, char * p_forma while (fgets(s, sizeof(s), f) != NULL){ //read the file #if defined(__i386) || defined(__x86_64) if (strncmp(s, "cpu MHz", 7) == 0) { //and search for the cpu mhz +#else +#if defined(__alpha) + if (strncmp(s, "cycle frequency [Hz]", 20) == 0) { // different on alpha #else if (strncmp(s, "clock", 5) == 0) { // this is different on ppc for some reason -#endif +#endif // defined(__alpha) +#endif // defined(__i386) || defined(__x86_64) + strcpy(frequency, strchr(s, ':') + 2); //copy just the number +#if defined(__alpha) + frequency[strlen(frequency) - 6] = '\0';// strip " est.\n" + freq = strtod(frequency, NULL)/1000000; // kernel reports in Hz +#else frequency[strlen(frequency) - 1] = '\0'; // strip \n freq = strtod(frequency, NULL); +#endif break; } }