$OpenBSD: patch-panel-plugin_main_c,v 1.1.1.1 2004/01/31 03:32:03 jolan Exp $
--- panel-plugin/main.c.orig	2003-11-11 06:40:34.000000000 -0600
+++ panel-plugin/main.c	2004-01-30 20:36:19.000000000 -0600
@@ -94,7 +94,7 @@ typedef enum monitor_bar_order_t {
 typedef struct param_t {
     /* Configurable parameters */
     char            acDevice[64];
-#if  !defined(__NetBSD__)
+#if  !defined(__NetBSD__) && !defined(__OpenBSD__)
     dev_t           st_rdev;
 #endif
     int             fTitleDisplayed;
@@ -162,7 +162,7 @@ static int DisplayPerf (struct plugin_t 
     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)
@@ -170,7 +170,7 @@ static int DisplayPerf (struct plugin_t 
 
     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);
@@ -210,7 +210,7 @@ static int DisplayPerf (struct plugin_t 
 	}
     }
 
-    sprintf (acToolTips, "%s\n"
+    snprintf (acToolTips, sizeof(acToolTips), "%s\n"
 	     "----------------\n"
 	     "I/O    (MB/s)\n"
 	     "  Read :%3u\n"
@@ -406,7 +406,7 @@ static plugin_t *NewPlugin ()
     struct plugin_t *poPlugin;
     struct param_t *poConf;
     struct monitor_t *poMonitor;
-#if !defined(__NetBSD__)
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
     struct stat     oStat;
     int             status;
 #endif
@@ -416,7 +416,7 @@ static plugin_t *NewPlugin ()
     poConf = &(poPlugin->oConf.oParam);
     poMonitor = &(poPlugin->oMonitor);
 
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
     strcpy (poConf->acDevice, "wd0");
     strcpy (poConf->acTitle, "wd0");
 #else
@@ -508,7 +508,7 @@ static void plugin_read_config (Control 
     Widget_t       *pw2ndBar = poPlugin->oMonitor.awProgressBar + 1;
     xmlNodePtr      poNode;
     char           *pc;
-#if !defined(__NetBSD__)
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
     struct stat     oStat;
     int             status;
 #endif
@@ -524,7 +524,7 @@ static void plugin_read_config (Control 
 	    memset (poConf->acDevice, 0, sizeof (poConf->acDevice));
 	    strncpy (poConf->acDevice, pc, sizeof (poConf->acDevice) - 1);
 	    xmlFree (pc);
-#if !defined(__NetBSD__)
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
 	    status = stat (poConf->acDevice, &oStat);
 	    poConf->st_rdev = (status == -1 ? 0 : oStat.st_rdev);
 #endif
@@ -660,7 +660,7 @@ static void SetDevice (Widget_t p_wTF, v
     struct plugin_t *poPlugin = (plugin_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;
 
