~ubuntu-branches/ubuntu/jaunty/monit/jaunty

« back to all changes in this revision

Viewing changes to device/sysdep_LINUX.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Alfredsson
  • Date: 2008-08-24 23:44:46 UTC
  • mfrom: (4.1.1 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080824234446-a3k8n02f52nio5dy
Tags: 1:4.10.1-4
* Patch for config file location was not applied (Closes: #479357)
  (thanks to DVZ-Team <dv-zentrum@fh-giessen.de>)
* The relocation patch created an unneccessary "file.c.orig", this
  was removed from the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C), 2000-2006 by the monit project group.
 
2
 * Copyright (C), 2000-2007 by the monit project group.
3
3
 * All Rights Reserved.
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or
6
6
 * modify it under the terms of the GNU General Public License as
7
 
 * published by the Free Software Foundation; either version 2 of the
 
7
 * published by the Free Software Foundation; either version 3 of the
8
8
 * License, or (at your option) any later version.
9
9
 *
10
10
 * This program is distributed in the hope that it will be useful, but
23
23
 *  @author Jan-Henrik Haukeland, <hauk@tildeslash.com>
24
24
 *  @author Martin Pala, <martinp@tildeslash.com>
25
25
 *
26
 
 *  @version \$Id: sysdep_LINUX.c,v 1.13 2006/04/27 20:16:03 martinp Exp $
 
26
 *  @version \$Id: sysdep_LINUX.c,v 1.18 2007/07/25 12:54:31 hauk Exp $
27
27
 *
28
28
 *  @file
29
29
 */
46
46
#include <strings.h>
47
47
#endif
48
48
 
49
 
#ifdef HAVE_SYS_VFS_H
50
 
# include <sys/vfs.h>
 
49
#ifdef HAVE_SYS_STATVFS_H
 
50
# include <sys/statvfs.h>
51
51
#endif
52
52
 
53
53
#ifdef HAVE_MNTENT_H
109
109
 */
110
110
int device_usage_sysdep(Info_T inf) {
111
111
 
112
 
  struct statfs usage;
 
112
  struct statvfs usage;
113
113
 
114
114
  ASSERT(inf);
115
115
 
116
 
  if(statfs(inf->mntpath, &usage) != 0) {
 
116
  if(statvfs(inf->mntpath, &usage) != 0) {
117
117
    LogError("%s: Error getting usage statistics for device '%s' -- %s\n",
118
118
        prog, inf->mntpath, STRERROR);
119
119
    return FALSE;
125
125
  inf->f_blocksfreetotal= usage.f_bfree;
126
126
  inf->f_files=           usage.f_files;
127
127
  inf->f_filesfree=       usage.f_ffree;
 
128
  inf->flags=             usage.f_flag;
128
129
 
129
130
  return TRUE;
130
131