--- 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:47:12 1.11 @@ -1,5 +1,6 @@ /* * i-scream central monitoring system + * http://www.i-scream.org.uk * Copyright (C) 2000-2002 i-scream * * This program is free software; you can redistribute it and/or @@ -116,8 +117,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 +155,7 @@ char *get_disk_stats(){ sd=sd_ptr; } - if ((fclose(f)) != 0) { + if ((endmntent(f)) != 0) { errf("Failed to close file (%m)"); return NULL; }