[Pkg-xfce-commits] r2194 - in goodies/xfce4-sensors-plugin/debian: . patches

corsac at alioth.debian.org corsac at alioth.debian.org
Wed Aug 6 06:12:01 UTC 2008


Author: corsac
Date: 2008-08-06 06:12:00 +0000 (Wed, 06 Aug 2008)
New Revision: 2194

Added:
   goodies/xfce4-sensors-plugin/debian/patches/01_fix-acpi-fan-infos.patch
Modified:
   goodies/xfce4-sensors-plugin/debian/changelog
Log:
* debian/patches:
  - 01_fix-acpi-fan-infos added, don't crash plugin when refreshing fan
    state. Thanks Daniel Gibson for debugging this and cooking the patch.
                                                              closes: #491480

Modified: goodies/xfce4-sensors-plugin/debian/changelog
===================================================================
--- goodies/xfce4-sensors-plugin/debian/changelog	2008-07-25 05:29:36 UTC (rev 2193)
+++ goodies/xfce4-sensors-plugin/debian/changelog	2008-08-06 06:12:00 UTC (rev 2194)
@@ -1,9 +1,16 @@
 xfce4-sensors-plugin (0.10.99.5~svn-r4998-2) UNRELEASED; urgency=low
 
+  [ Stefan Ott ]
   * debian/control: update e-mail address
 
- -- Stefan Ott <stefan at ott.net>  Sat, 12 Jul 2008 03:47:21 +0200
+  [ Yves-Alexis Perez ]
+  * debian/patches:
+    - 01_fix-acpi-fan-infos added, don't crash plugin when refreshing fan
+      state. Thanks Daniel Gibson for debugging this and cooking the patch.
+                                                                closes: #491480
 
+ -- Yves-Alexis Perez <corsac at debian.org>  Wed, 06 Aug 2008 08:01:59 +0200
+
 xfce4-sensors-plugin (0.10.99.5~svn-r4998-1) unstable; urgency=low
 
   * New upstream svn snapshot.

Added: goodies/xfce4-sensors-plugin/debian/patches/01_fix-acpi-fan-infos.patch
===================================================================
--- goodies/xfce4-sensors-plugin/debian/patches/01_fix-acpi-fan-infos.patch	                        (rev 0)
+++ goodies/xfce4-sensors-plugin/debian/patches/01_fix-acpi-fan-infos.patch	2008-08-06 06:12:00 UTC (rev 2194)
@@ -0,0 +1,32 @@
+--- xfce4-sensors-plugin-0.10.99.5.orig/panel-plugin/acpi.c	2008-08-06 01:56:00.063518101 +0200
++++ xfce4-sensors-plugin-0.10.99.5/panel-plugin/acpi.c	2008-08-06 03:11:08.635447284 +0200
+@@ -445,7 +445,7 @@
+ void
+ refresh_acpi (gpointer chip_feature, gpointer data)
+ {
+-    char *file, *zone;
++    char *file, *zone, *state;
+     t_chipfeature *cf;
+ 
+     TRACE ("enters refresh_acpi");
+@@ -472,8 +472,18 @@
+             break;
+ 
+         case STATE:
+-            file = g_strdup_printf ("%s/%s/state", ACPI_DIR_FAN, cf->devicename);
+-            cf->raw_value = strcmp(get_acpi_value(file), "on")==0 ? 1.0 : 0.0;
++            // get_acpi_value() expects a _full_ path (unlike get_acpi_zone_value() etc)!
++            file = g_strdup_printf ("%s/%s/%s/state", ACPI_PATH, ACPI_DIR_FAN, cf->devicename);
++            state = get_acpi_value(file);
++            // if get_acpi_value has returned NULL (=> the file hasn't been found)
++            // we display the fan as "off"
++            if(state==NULL){
++                DBG("get_acpi_value has returned NULL!");
++                cf->raw_value = 0.0;
++                break;
++            }
++            // on my box there is a \n after "on".. dunno if that's normal, so i only compare 2 chars
++            cf->raw_value = strncmp(state, "on", 2)==0 ? 1.0 : 0.0;
+             g_free (file);
+             /* g_free (cf->formatted_value);
+             cf->formatted_value = g_strdup_printf (_("%.0f"), cf->raw_value); */




More information about the Pkg-xfce-commits mailing list