patches/gnome-applets-04-make-multiload-network-available.diff
changeset 8181 4565c28a04fd
parent 8155 578ea9f1b4db
--- a/patches/gnome-applets-04-make-multiload-network-available.diff	Fri Sep 22 05:13:22 2006 +0000
+++ b/patches/gnome-applets-04-make-multiload-network-available.diff	Fri Sep 22 08:18:29 2006 +0000
@@ -1,13 +1,37 @@
-diff -Nrup gnome-applets-2.14.1/multiload/linux-proc.c gnome-applets-2.14.1.mod/multiload/linux-proc.c
---- gnome-applets-2.14.1/multiload/linux-proc.c	2006-01-15 17:31:02.000000000 +0800
-+++ gnome-applets-2.14.1.mod/multiload/linux-proc.c	2006-07-28 11:22:34.324755000 +0800
-@@ -306,7 +306,8 @@ GetNet (int Maximum, int data [5], LoadG
+diff -Nrup gnome-applets-2.16.0.1/multiload/linux-proc.c gnome-applets-2.16.0.1.mod/multiload/linux-proc.c
+--- gnome-applets-2.16.0.1/multiload/linux-proc.c	2006-09-22 15:05:23.951580000 +0800
++++ gnome-applets-2.16.0.1.mod/multiload/linux-proc.c	2006-09-22 15:15:46.740769000 +0800
+@@ -115,6 +115,13 @@ GetDiskLoad (int Maximum, int data [3], 
+ 
+ 	read = write = 0;
  
- 	glibtop_get_netload(&netload, devices[i]);
++
++        /*
++          At the moment, Solaris can't get the read/write information for filesystem
++          so we would like to use disk to get them, later when some unstable interfaces
++          become statble or public, will use them
++        */
++        /*
+ 	mountentries = glibtop_get_mountlist (&mountlist, FALSE);
  
--	g_return_if_fail((netload.flags & needed_netload_flags) == needed_netload_flags);
-+        if ((netload.flags & needed_netload_flags) != needed_netload_flags)
-+           continue;
+ 	for (i = 0; i < mountlist.number; i++)
+@@ -131,6 +138,10 @@ GetDiskLoad (int Maximum, int data [3], 
+ 	}
+ 
+ 	g_free(mountentries);
++        */
++        glibtop_fsusage fsusage;
++        glibtop_get_fsusage(&fsusage,"/"); /* "/" will not use, just as a input */
++        read = fsusage.read; write = fsusage.write;
  
- 	if (!(netload.if_flags & (1L << GLIBTOP_IF_FLAGS_UP)))
- 	    continue;
+ 	readdiff  = read - lastread;
+ 	writediff = write - lastwrite;
+@@ -300,7 +311,7 @@ GetNet (int Maximum, int data [5], LoadG
+ 	autoscaler_init(&scaler, 60, 501);
+     }
+ 
+-
++    netlist.flags = 1;
+     devices = glibtop_get_netlist(&netlist);
+ 
+     for(i = 0; i < netlist.number; ++i)