summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorPhilippe De Swert <philippedeswert@scarlet.be>2006-02-07 19:23:36 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-02-07 19:23:36 +0000
commitb82303793e429d2e44ac574161636a18a82df08a (patch)
tree66b00897410c6860331a275fed696f9dbc950931 /packages
parent615128a1d09c232329b9001fe3f640f8e3a52722 (diff)
packages/matchbox-panel/matchbox-panel-0.9.2/system-monitor-crash-fix.patch
* update patch to avoid compile time cpu selection packages/matchbox-panel/matchbox-panel-0.9.2/matchbox-panel_0.9.2.bb * bunp PR number
Diffstat (limited to 'packages')
-rw-r--r--packages/matchbox-panel/matchbox-panel-0.9.2/system-monitor-crash-fix.patch72
-rw-r--r--packages/matchbox-panel/matchbox-panel_0.9.2.bb2
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 \