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 |
|
} |
576 |
|
n++; |
577 |
|
} |
578 |
|
|
579 |
+ |
fclose(f); |
580 |
+ |
|
581 |
|
if (!has_pp_stats) { |
582 |
< |
/* This is an older kernel without stats in /proc/partitions. |
583 |
< |
Read what we can from /proc/stat instead. */ |
582 |
> |
/* This is an older kernel where /proc/partitions doesn't |
583 |
> |
contain stats. Read what we can from /proc/stat instead, and |
584 |
> |
fill in the appropriate bits of the list allocated above. */ |
585 |
|
|
586 |
|
f = fopen("/proc/stat", "r"); |
587 |
|
if (f == NULL) goto out; |