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