[Xfce4-commits] [panel-plugins/xfce4-diskperf-plugin] 03/03: Allow for MaxIO up to 32Gb/s (bug #15376)

noreply at xfce.org noreply at xfce.org
Thu May 16 21:49:10 CEST 2019


This is an automated email from the git hooks/post-receive script.

l   a   n   d   r   y       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-diskperf-plugin.

commit 1542c4af1754e011802c4a3ebbc799fad8958702
Author: Landry Breuil <landry at xfce.org>
Date:   Thu May 16 21:48:55 2019 +0200

    Allow for MaxIO up to 32Gb/s (bug #15376)
---
 panel-plugin/config_gui.c | 2 +-
 panel-plugin/main.c       | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/config_gui.c b/panel-plugin/config_gui.c
index 2e79c6b..cbe3904 100644
--- a/panel-plugin/config_gui.c
+++ b/panel-plugin/config_gui.c
@@ -200,7 +200,7 @@ int CreateConfigGUI (GtkWidget * vbox1, struct gui_t *p_poGUI)
     gtk_box_pack_start (GTK_BOX (wHBox_MaxIO), wTF_MaxXfer, FALSE, TRUE, 0);
     gtk_widget_set_tooltip_text (wTF_MaxXfer,
 			  _("Input the maximum I/O transfer rate of the device, then press <Enter>"));
-    gtk_entry_set_max_length (GTK_ENTRY (wTF_MaxXfer), 3);
+    gtk_entry_set_max_length (GTK_ENTRY (wTF_MaxXfer), 5);
     gtk_entry_set_text (GTK_ENTRY (wTF_MaxXfer), _("35"));
 
     hseparator8 = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
diff --git a/panel-plugin/main.c b/panel-plugin/main.c
index cf4843a..8088a27 100644
--- a/panel-plugin/main.c
+++ b/panel-plugin/main.c
@@ -38,6 +38,7 @@
 #include <string.h>
 #include <errno.h>
 #include <sys/stat.h>
+#include <stdint.h>
 
 #define PLUGIN_NAME	"DiskPerf"
 #define BORDER          8
@@ -825,8 +826,8 @@ static void SetXferRate (Widget_t p_wTF, void *p_pvPlugin)
 
     /* Make it a multiple of 5 MB/s */
     poConf->iMaxXferMBperSec = 5 * round((double) atoi(pcXferRate) / 5);
-    if (poConf->iMaxXferMBperSec > 995)
-	poConf->iMaxXferMBperSec = 995;
+    if (poConf->iMaxXferMBperSec > INT16_MAX)
+	poConf->iMaxXferMBperSec = INT16_MAX - 2;
     else if (poConf->iMaxXferMBperSec < 5)
 	poConf->iMaxXferMBperSec = 5;
     DBG("XferRate rounded to %dMb/s\n", poConf->iMaxXferMBperSec);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list