[Goodies-commits] r4572 - xfce4-diskperf-plugin/trunk/panel-plugin

Landry Breuil landry at xfce.org
Mon Apr 14 21:44:59 CEST 2008


Author: landry
Date: 2008-04-14 19:44:59 +0000 (Mon, 14 Apr 2008)
New Revision: 4572

Modified:
   xfce4-diskperf-plugin/trunk/panel-plugin/main.c
Log:
Apply second patch from OpenBSD cvs.
It still need bugfixes to display accurate values.


Modified: xfce4-diskperf-plugin/trunk/panel-plugin/main.c
===================================================================
--- xfce4-diskperf-plugin/trunk/panel-plugin/main.c	2008-04-14 19:28:39 UTC (rev 4571)
+++ xfce4-diskperf-plugin/trunk/panel-plugin/main.c	2008-04-14 19:44:59 UTC (rev 4572)
@@ -80,7 +80,7 @@
 typedef struct param_t {
     /* Configurable parameters */
     char            acDevice[64];
-#if  !defined(__NetBSD__)
+#if  !defined(__NetBSD__) && !defined(__OpenBSD__)
     dev_t           st_rdev;
 #endif
     int             fTitleDisplayed;
@@ -151,7 +151,7 @@
     const double    K = 1.0 * 1000 * 1000 * 1000 / 1024 / 1024;
     /* bytes/ns --> MB/s */
     double          arPerf[NMONITORS], arBusy[NMONITORS], *prData, *pr;
-    char            acToolTips[128];
+    char            acToolTips[256];
     int             status, i;
 
     if (!s_poToolTips)
@@ -159,7 +159,7 @@
 
     memset (&oPerf, 0, sizeof (oPerf));
     oPerf.qlen = -1;
-#if defined (__NetBSD__)
+#if defined (__NetBSD__) || defined(__OpenBSD__)
     status = DevGetPerfData (poConf->acDevice, &oPerf);
 #else
     status = DevGetPerfData (&(poConf->st_rdev), &oPerf);
@@ -199,7 +199,7 @@
 	}
     }
 
-    sprintf (acToolTips, "%s\n"
+    snprintf (acToolTips, sizeof(acToolTips), "%s\n"
 	     "----------------\n"
 	     "I/O    (MB/s)\n"
 	     "  Read :%3u\n"
@@ -400,7 +400,7 @@
     struct diskperf_t *poPlugin;
     struct param_t *poConf;
     struct monitor_t *poMonitor;
-#if !defined(__NetBSD__)
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
     struct stat     oStat;
     int             status;
 #endif
@@ -412,7 +412,7 @@
 
     poPlugin->plugin = plugin;
     
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
     strcpy (poConf->acDevice, "wd0");
     strcpy (poConf->acTitle, "wd0");
 #else
@@ -500,7 +500,7 @@
     if ((value = xfce_rc_read_entry (rc, (CONF_DEVICE), NULL))) {
         memset (poConf->acDevice, 0, sizeof (poConf->acDevice));
         strncpy (poConf->acDevice, value, sizeof (poConf->acDevice) - 1);
-#if !defined(__NetBSD__)
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
         status = stat (poConf->acDevice, &oStat);
         poConf->st_rdev = (status == -1 ? 0 : oStat.st_rdev);
 #endif
@@ -623,7 +623,7 @@
     struct diskperf_t *poPlugin = (diskperf_t *) p_pvPlugin;
     struct param_t *poConf = &(poPlugin->oConf.oParam);
     const char     *pcDevice = gtk_entry_get_text (GTK_ENTRY (p_wTF));
-#if !defined(__NetBSD__)
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
     struct stat     oStat;
     int             status;
 




More information about the Goodies-commits mailing list