[Xfce4-commits] <xfce4-sensors-plugin:master> revised patch for non-necat patch that unfortunately is run by the netcat ifdefs instead of its own ifdefs. will have to fix at a later point when I have an idea on how to detect hddtemp without any netcat instance

Fabian noreply at xfce.org
Sat Mar 26 21:02:01 CET 2011


Updating branch refs/heads/master
         to 8ee04b6b287f9fa47273596128f6ea2a57aaf13f (commit)
       from f36c5eafa272255b0faa2b1bab923af8d8269a00 (commit)

commit 8ee04b6b287f9fa47273596128f6ea2a57aaf13f
Author: Fabian <timystery at arcor.de>
Date:   Sat Mar 26 21:00:55 2011 +0100

    revised patch for non-necat patch that unfortunately is run by the netcat ifdefs instead of its own ifdefs. will have to fix at a later point when I have an idea on how to detect hddtemp without any netcat instance

 lib/hddtemp.c           |   20 ++++++++++++--------
 lib/sensors-interface.c |    4 ++--
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/lib/hddtemp.c b/lib/hddtemp.c
index 4218588..ce64adb 100644
--- a/lib/hddtemp.c
+++ b/lib/hddtemp.c
@@ -62,19 +62,19 @@
 #include <unistd.h>
 
 #ifdef HAVE_NETCAT
-#include "helpers.c"
+# include "helpers.c"
 # ifndef NETCAT_PATH
 #  define NETCAT_PATH "/bin/netcat"
 # endif
-
-# ifndef HDDTEMP_PORT
-#  define HDDTEMP_PORT 7634
-# endif
-
 # define DOUBLE_DELIMITER "||"
 # define SINGLE_DELIMITER "|"
 #endif
 
+#ifndef HDDTEMP_PORT
+# define HDDTEMP_PORT 7634
+#endif
+
+
 #define REPLY_MAX_SIZE 512
 
 
@@ -86,6 +86,9 @@ void notification_suppress_messages (NotifyNotification *n, gchar *action, gpoin
 void quick_message_notify (gchar *message);
 void quick_message (gchar *message);
 void read_disks_netcat (t_chip *chip);
+void read_disks_linux26 (t_chip *chip);
+int get_hddtemp_d_str (char *buffer, size_t bufsize);
+void read_disks_fallback (t_chip *chip);
 void remove_unmonitored_drives (t_chip *chip, gboolean *suppressmessage);
 void populate_detected_drives (t_chip *chip);
 
@@ -498,8 +501,7 @@ get_hddtemp_value (char* disk, gboolean *suppressmessage)
 {
     gchar *standard_output=NULL, *standard_error=NULL;
     gchar *cmd_line=NULL, *msg_text=NULL;
-    char reply[REPLY_MAX_SIZE];
-    size_t read_size;
+
 #ifndef HAVE_LIBNOTIFY
     gchar *checktext = NULL;
 #endif
@@ -510,6 +512,8 @@ get_hddtemp_value (char* disk, gboolean *suppressmessage)
 
 #ifdef HAVE_NETCAT
     gchar *tmp, *tmp2, *tmp3;
+		char reply[REPLY_MAX_SIZE];
+    size_t read_size;
 #endif
 
     if (suppressmessage!=NULL)
diff --git a/lib/sensors-interface.c b/lib/sensors-interface.c
index 6f32e87..faac457 100644
--- a/lib/sensors-interface.c
+++ b/lib/sensors-interface.c
@@ -175,6 +175,7 @@ add_type_box (GtkWidget * vbox, t_sensors_dialog * sd)
         gtk_combo_box_get_active(GTK_COMBO_BOX(sd->myComboBox));
 
     chip = g_ptr_array_index (sd->sensors->chips, gtk_combo_box_active);
+		DBG("index: %d, chip: %p\n", gtk_combo_box_active, chip);
 
     /* if (sd->sensors->num_sensorchips > 0)
         sd->mySensorLabel = gtk_label_new
@@ -191,8 +192,7 @@ add_type_box (GtkWidget * vbox, t_sensors_dialog * sd)
     gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
     gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
 
-    sd->mySensorLabel =
-            gtk_label_new (chip->description);
+    sd->mySensorLabel = gtk_label_new (chip->description);
 
     gtk_widget_show (sd->mySensorLabel);
     gtk_box_pack_start (GTK_BOX (hbox), sd->mySensorLabel, FALSE, FALSE, 0);



More information about the Xfce4-commits mailing list