diff options
author | Justin Patrin <papercrane@gmail.com> | 2006-02-08 21:11:03 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2006-02-08 21:11:03 +0000 |
commit | 5bf510d4128ad91f1b100fc80e3f2893dc20f686 (patch) | |
tree | 067b036d81d6e36773132cce1fd790d8b4272091 /packages | |
parent | e12a4096b6963470a4485af87446189b25cb43b4 (diff) | |
parent | 35fedf01c12bcd0b9409a359e91b66d20b3a4c79 (diff) |
merge of 18dd8cf21b475b0438065a81c795a331d4dd1076
and 4a2edc2b9931c29b07ce96536e36250048aa6e97
Diffstat (limited to 'packages')
-rw-r--r-- | packages/matchbox-panel/matchbox-panel-0.9.2/system-monitor-crash-fix.patch | 72 | ||||
-rw-r--r-- | packages/matchbox-panel/matchbox-panel_0.9.2.bb | 2 |
2 files changed, 54 insertions, 20 deletions
diff --git a/packages/matchbox-panel/matchbox-panel-0.9.2/system-monitor-crash-fix.patch b/packages/matchbox-panel/matchbox-panel-0.9.2/system-monitor-crash-fix.patch index c9a49fb881..51c141db03 100644 --- a/packages/matchbox-panel/matchbox-panel-0.9.2/system-monitor-crash-fix.patch +++ b/packages/matchbox-panel/matchbox-panel-0.9.2/system-monitor-crash-fix.patch @@ -1,23 +1,46 @@ ---- matchbox-panel-0.9.2/applets/mb-applet-system-monitor.c.orig 2006-02-04 19:22:55.000000000 +0200 -+++ matchbox-panel-0.9.2/applets/mb-applet-system-monitor.c 2006-02-04 18:18:21.000000000 +0200 -@@ -37,6 +37,16 @@ +--- matchbox-panel-0.9.2/applets/mb-applet-system-monitor.c.orig 2006-02-07 20:08:09.000000000 +0200 ++++ matchbox-panel-0.9.2/applets/mb-applet-system-monitor.c 2006-02-07 20:53:20.000000000 +0200 +@@ -37,6 +37,7 @@ # define _(text) (text) #endif -+#ifdef HAVE_LINUX_VER_H -+#include <linux/version.h> -+#else -+#define LINUX_VERSION_CODE 0 -+#endif -+ -+#ifndef KERNEL_VERSION -+#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c)) -+#endif + #ifdef MB_HAVE_PNG #define IMG_EXT "png" #else -@@ -112,71 +122,83 @@ +@@ -66,8 +67,30 @@ + MBPixbufImage *ImgIcon = NULL, *ImgIconScaled = NULL, *ImgGraph = NULL; + + int GraphHeight = 0, GraphWidth = 0; +- + char *ThemeName; ++static int kernelver = 0; ++ ++/* returns 1 if the kernel version is 2.6, 0 otherwise */ ++int kernel_version(void) ++{ ++ float v_nr=0; ++ FILE *version; ++ ++ if ((version = fopen("/proc/version", "r")) == NULL) ++ { ++ fprintf(stderr, "mb-applet-system-monitor: failed to open /proc/version. Exiting\n"); ++ exit(1); ++ } ++ fscanf(version, "%*s %*s %f", &v_nr); ++ fclose(version); ++ ++ if (v_nr > 2.5) ++ return 1; ++ else ++ return 0; ++} ++ ++ + + /* returns current CPU load in percent, 0 to 100 */ + int system_cpu(void) +@@ -112,71 +135,86 @@ int system_memory(void) { @@ -94,14 +117,15 @@ - msd.mem_percent = (100 * msd.mem_used) / msd.mem_max; - //msd.swap_percent = (100 * msd.swap_used) / msd.swap_max; -- ++/*if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)*/ + - /* memory info changed - update things */ - return 1; - } - /* nothing new */ - return 0; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -+ ++ if(kernelver) ++ { + rewind (mem); + + fscanf (mem, "%*s %Ld %*s", &total); @@ -126,15 +150,16 @@ + shared = shared * 1024; + cache_total = cache_total * 1024; + cache_used = cache_total - (cache_free * 1024); -+#else ++ } ++else ++ { + /* + total: used: free: shared: buffers: cached: + */ + fscanf(mem, "%*s %Ld %Ld %Ld %Ld %Ld %Ld", &total, &used, &mfree, + &shared, &buffers, &cached); + fscanf(mem, "%*s %Ld %Ld", &cache_total, &cache_used); -+ -+#endif ++ } + + fclose(mem); + @@ -159,3 +184,12 @@ void paint_callback (MBTrayApp *app, Drawable drw ) { +@@ -340,6 +378,8 @@ + &argc, + &argv ); + ++ kernelver = kernel_version(); ++ + msd.samples = 16; + + if (msd.load) { diff --git a/packages/matchbox-panel/matchbox-panel_0.9.2.bb b/packages/matchbox-panel/matchbox-panel_0.9.2.bb index 4c037690b6..0e2ccf3f07 100644 --- a/packages/matchbox-panel/matchbox-panel_0.9.2.bb +++ b/packages/matchbox-panel/matchbox-panel_0.9.2.bb @@ -1,6 +1,6 @@ include matchbox-panel.inc -PR="r9" +PR="r10" SRC_URI = "http://projects.o-hand.com/matchbox/sources/${PN}/0.9/${PN}-${PV}.tar.gz \ file://add_hostap.patch;patch=1 \ http://handhelds.org/~pb/mb-panel-0.9.2-polling.patch;patch=1 \ |