--- projects/libstatgrab/src/libstatgrab/disk_stats.c 2003/10/09 14:59:52 1.27 +++ projects/libstatgrab/src/libstatgrab/disk_stats.c 2003/10/09 15:22:59 1.28 @@ -342,14 +342,16 @@ diskio_stat_t *get_diskio_stats(int *entries){ if(stats.dinfo==NULL) return NULL; stats_init = 1; } +#ifdef FREEBSD5 + if ((devstat_getdevs(NULL, &stats)) < 0) return NULL; + /* Not aware of a get all devices, so i said 999. If we ever * find a machine with more than 999 disks, then i'll change * this number :) */ + 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; +#else if ((getdevs(&stats)) < 0) return NULL; /* Not aware of a get all devices, so i said 999. If we ever * find a machine with more than 999 disks, then i'll change * this number :) */ -#ifdef FREEBSD5 - if ((devstat_getdevs(NULL, &stats)) < 0) return NULL; -#else 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; #endif