ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/disk_stats.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/disk_stats.c (file contents):
Revision 1.41 by ats, Mon Nov 10 23:32:59 2003 UTC vs.
Revision 1.46 by ats, Sat Jan 10 16:12:34 2004 UTC

# Line 503 | Line 503 | diskio_stat_t *get_diskio_stats(int *entries){
503  
504                          if(diskio_stats_ptr->disk_name!=NULL) free(diskio_stats_ptr->disk_name);
505  
506 <                        diskio_stats_ptr->disk_name=strdup(ksp->ks_name);
506 >                        diskio_stats_ptr->disk_name=strdup((char *) get_svr_from_bsd(ksp->ks_name));
507                          diskio_stats_ptr->systime=time(NULL);
508                          num_diskio++;
509                  }
# Line 576 | Line 576 | diskio_stat_t *get_diskio_stats(int *entries){
576                  n++;
577          }
578  
579 +        fclose(f);
580 +        f = NULL;
581 +
582          if (!has_pp_stats) {
583 <                /* This is an older kernel without stats in /proc/partitions.
584 <                   Read what we can from /proc/stat instead. */
583 >                /* This is an older kernel where /proc/partitions doesn't
584 >                   contain stats. Read what we can from /proc/stat instead, and
585 >                   fill in the appropriate bits of the list allocated above. */
586  
587                  f = fopen("/proc/stat", "r");
588                  if (f == NULL) goto out;
# Line 645 | Line 649 | diskio_stat_t *get_diskio_stats(int *entries){
649          num_diskio = n;
650   out:
651          if (f != NULL) fclose(f);
652 + #endif
653  
654 + #ifdef CYGWIN
655 +        return NULL;
656   #endif
657 +
658          *entries=num_diskio;
659  
660          return diskio_stats;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines