mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-23 15:18:35 +00:00
alpha cpu freq patch
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@540 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
d346224988
commit
838da14952
3
AUTHORS
3
AUTHORS
@ -139,6 +139,9 @@ Roman Bogorodskiy <novel at clublife dot ru>
|
||||
Szymon Boniecki
|
||||
Reads current LC_TIME
|
||||
|
||||
Thomas Cort
|
||||
CPU frequency patch for alpha
|
||||
|
||||
Toni <bleach at users dot sourceforge dot net>
|
||||
exec*/tail/head output evalution
|
||||
|
||||
|
@ -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)
|
||||
|
12
src/linux.c
12
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user