Home | History | Annotate | Download | only in patches
      1  10186    henryz --- gnome-applets-2.17.1/multiload/linux-proc.c	2006-12-31 10:07:39.000000000 +0800
      2  10186    henryz +++ gnome-applets-2.17.1.mod/multiload/linux-proc.c	2007-01-09 19:15:24.881474000 +0800
      3   9303  hz159841 @@ -115,6 +115,13 @@ GetDiskLoad (int Maximum, int data [3], 
      4   8839   darrenk  
      5   9303  hz159841  	read = write = 0;
      6   8839   darrenk  
      7   9303  hz159841 +
      8   9303  hz159841 +        /*
      9   9303  hz159841 +          At the moment, Solaris can't get the read/write information for filesystem
     10   9303  hz159841 +          so we would like to use disk to get them, later when some unstable interfaces
     11   9303  hz159841 +          become statble or public, will use them
     12   9303  hz159841 +        */
     13   9303  hz159841 +        /*
     14   9303  hz159841  	mountentries = glibtop_get_mountlist (&mountlist, FALSE);
     15   8839   darrenk  
     16   9303  hz159841  	for (i = 0; i < mountlist.number; i++)
     17   9303  hz159841 @@ -131,6 +138,10 @@ GetDiskLoad (int Maximum, int data [3], 
     18   9303  hz159841  	}
     19   9303  hz159841  
     20   9303  hz159841  	g_free(mountentries);
     21   9303  hz159841 +        */
     22   9303  hz159841 +        glibtop_fsusage fsusage;
     23   9303  hz159841 +        glibtop_get_fsusage(&fsusage,"/"); /* "/" will not use, just as a input */
     24   9303  hz159841 +        read = fsusage.read; write = fsusage.write;
     25   9303  hz159841  
     26   9303  hz159841  	readdiff  = read - lastread;
     27   9303  hz159841  	writediff = write - lastwrite;
     28   9303  hz159841 @@ -300,7 +311,7 @@ GetNet (int Maximum, int data [5], LoadG
     29   9303  hz159841  	autoscaler_init(&scaler, 60, 501);
     30   9303  hz159841      }
     31   9303  hz159841  
     32   9303  hz159841 -
     33   9303  hz159841 +    netlist.flags = 1;
     34   9303  hz159841      devices = glibtop_get_netlist(&netlist);
     35   9303  hz159841  
     36   9303  hz159841      for(i = 0; i < netlist.number; ++i)
     37  10186    henryz @@ -310,7 +321,12 @@ GetNet (int Maximum, int data [5], LoadG
     38  10186    henryz  
     39  10186    henryz  	glibtop_get_netload(&netload, devices[i]);
     40  10186    henryz  
     41  10186    henryz -	g_return_if_fail((netload.flags & needed_netload_flags) == needed_netload_flags);
     42  10186    henryz +        /* this is not correct, because after run get netlist, there are lots of net devices,
     43  10186    henryz +           not all of them meet the requirement of needed_netload_flags, but we don't need to
     44  10186    henryz +           exit, we can just ignore them, and try to continue with the next one */
     45  10186    henryz +        if ((netload.flags & needed_netload_flags) != needed_netload_flags)
     46  10186    henryz +            continue;
     47  10186    henryz +
     48  10186    henryz  
     49  10186    henryz  	if (!(netload.if_flags & (1L << GLIBTOP_IF_FLAGS_UP)))
     50  10186    henryz  	    continue;
     51