--- projects/cms/source/ihost/libstatgrab/disk_stat.c 2002/05/19 20:54:10 1.9 +++ projects/cms/source/ihost/libstatgrab/disk_stat.c 2002/05/21 16:16:41 1.10 @@ -116,8 +116,8 @@ char *get_disk_stats(){ } #endif -#ifdef linux - if ((f=fopen("/etc/mtab", "r" ))==NULL){ +#ifdef LINUX + if ((f=setmntent("/etc/mtab", "r" ))==NULL){ errf("Failed to open mounts (%m)"); return NULL; } @@ -154,7 +154,7 @@ char *get_disk_stats(){ sd=sd_ptr; } - if ((fclose(f)) != 0) { + if ((endmntent(f)) != 0) { errf("Failed to close file (%m)"); return NULL; }