ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/ihost/libstatgrab/disk_stat.c
(Generate patch)

Comparing projects/cms/source/ihost/libstatgrab/disk_stat.c (file contents):
Revision 1.9 by pajs, Sun May 19 20:54:10 2002 UTC vs.
Revision 1.13 by tdb, Wed May 29 19:41:59 2002 UTC

# Line 1 | Line 1
1   /*
2   * i-scream central monitoring system
3 + * http://www.i-scream.org.uk
4   * Copyright (C) 2000-2002 i-scream
5   *
6   * This program is free software; you can redistribute it and/or
# Line 17 | Line 18
18   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19   */
20  
21 + #ifdef HAVE_CONFIG_H
22 + #include "config.h"
23 + #endif
24 +
25   #include <stdlib.h>
26   #include <stdio.h>
27   #include "ukcprog.h"
# Line 116 | Line 121 | char *get_disk_stats(){
121          }
122  
123   #endif
124 < #ifdef linux
125 <        if ((f=fopen("/etc/mtab", "r" ))==NULL){
124 > #ifdef LINUX
125 >        if ((f=setmntent("/etc/mtab", "r" ))==NULL){
126                  errf("Failed to open mounts (%m)");
127                  return NULL;
128          }
# Line 154 | Line 159 | char *get_disk_stats(){
159                  sd=sd_ptr;
160          }
161  
162 <        if ((fclose(f)) != 0) {
158 <                errf("Failed to close file (%m)");
159 <                return NULL;
160 <        }
162 >        endmntent(f);
163  
164   #endif
165   #ifdef FREEBSD

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines