[Nagiosplug-checkins] nagiosplug/lib mountlist.c,1.5,1.6

Holger Weiss hweiss at users.sourceforge.net
Tue Jan 23 15:39:11 CET 2007


Update of /cvsroot/nagiosplug/nagiosplug/lib
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29180

Modified Files:
	mountlist.c 
Log Message:
Add support for statvfs(2) which is needed in order to compile the plugins on
NetBSD 3.0 and newer.  The current coreutils release supports statvfs(2), so
this patch won't be needed anymore when updating the coreutils files.


Index: mountlist.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/lib/mountlist.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mountlist.c	18 May 2006 22:05:42 -0000	1.5
+++ mountlist.c	23 Jan 2007 14:39:09 -0000	1.6
@@ -101,6 +101,11 @@
 # include <sys/statfs.h>
 #endif
 
+#ifdef STAT_STATVFS
+# include <sys/statvfs.h>
+# define statfs statvfs
+#endif
+
 #ifdef MOUNTED_LISTMNTENT
 # include <mntent.h>
 #endif
@@ -162,7 +167,7 @@
 
 #if MOUNTED_GETMNTINFO
 
-# if ! HAVE_F_FSTYPENAME_IN_STATFS
+# if ! HAVE_F_FSTYPENAME_IN_STATFS && ! STAT_STATVFS
 static char *
 fstype_to_string (short int t)
 {
@@ -262,7 +267,7 @@
 static char *
 fsp_to_string (const struct statfs *fsp)
 {
-# if defined HAVE_F_FSTYPENAME_IN_STATFS
+# if defined HAVE_F_FSTYPENAME_IN_STATFS || defined STAT_STATVFS
   return (char *) (fsp->f_fstypename);
 # else
   return fstype_to_string (fsp->f_type);





More information about the Commits mailing list