325 |
|
time_t now; |
326 |
|
#endif |
327 |
|
#ifdef FREEBSD |
328 |
< |
struct statinfo stats; |
328 |
> |
static struct statinfo stats; |
329 |
> |
static int stats_init = 0; |
330 |
|
int counter; |
331 |
|
struct device_selection *dev_sel = NULL; |
332 |
|
int n_selected, n_selections; |
336 |
|
num_diskio=0; |
337 |
|
|
338 |
|
#ifdef FREEBSD |
339 |
< |
stats.dinfo=malloc(sizeof(struct devinfo)); |
340 |
< |
if(stats.dinfo==NULL) return NULL; |
339 |
> |
if (!stats_init) { |
340 |
> |
stats.dinfo=malloc(sizeof(struct devinfo)); |
341 |
> |
if(stats.dinfo==NULL) return NULL; |
342 |
> |
stats_init = 1; |
343 |
> |
} |
344 |
|
if ((getdevs(&stats)) < 0) return NULL; |
345 |
|
/* Not aware of a get all devices, so i said 999. If we ever |
346 |
|
* find a machine with more than 999 disks, then i'll change |