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.27 by pajs, Thu Oct 9 14:59:52 2003 UTC vs.
Revision 1.29 by ats, Sat Oct 18 22:16:44 2003 UTC

# Line 342 | Line 342 | diskio_stat_t *get_diskio_stats(int *entries){
342                  if(stats.dinfo==NULL) return NULL;
343                  stats_init = 1;
344          }
345 <        if ((getdevs(&stats)) < 0) return NULL;
345 > #ifdef FREEBSD5
346 >        if ((devstat_getdevs(NULL, &stats)) < 0) return NULL;
347          /* Not aware of a get all devices, so i said 999. If we ever
348           * find a machine with more than 999 disks, then i'll change
349           * this number :)
350           */
351 < #ifdef FREEBSD5
351 <        if ((devstat_getdevs(NULL, &stats)) < 0) return NULL;
351 >        if (devstat_selectdevs(&dev_sel, &n_selected, &n_selections, &sel_gen, stats.dinfo->generation, stats.dinfo->devices, stats.dinfo->numdevs, NULL, 0, NULL, 0, DS_SELECT_ONLY, 999, 1) < 0) return NULL;
352   #else
353 +        if ((getdevs(&stats)) < 0) return NULL;
354 +        /* Not aware of a get all devices, so i said 999. If we ever
355 +         * find a machine with more than 999 disks, then i'll change
356 +         * this number :)
357 +         */
358          if (selectdevs(&dev_sel, &n_selected, &n_selections, &sel_gen, stats.dinfo->generation, stats.dinfo->devices, stats.dinfo->numdevs, NULL, 0, NULL, 0, DS_SELECT_ONLY, 999, 1) < 0) return NULL;
359   #endif
360  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines