? gnome-vfs-2.4.2
? gnome-vfs-2.4.2.tar.gz
? portability-24.diff
? stat.diff
? statfs.diff
? doc/gnome-vfs-2.0-decl-list.txt
? doc/gnome-vfs-2.0-decl.txt
? doc/gnome-vfs-2.0-undocumented.txt
? doc/gnome-vfs-2.0-unused.txt
? doc/gnome-vfs-2.0.args
? doc/gnome-vfs-2.0.hierarchy
? doc/gnome-vfs-2.0.signals
? doc/version.xml
? doc/xml
? doc/tmpl/gnome-vfs-2.0-unused.sgml
? doc/tmpl/gnome-vfs.sgml
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-vfs/ChangeLog,v
retrieving revision 1.1610.2.24
diff -u -r1.1610.2.24 ChangeLog
--- ChangeLog	8 Mar 2004 20:14:11 -0000	1.1610.2.24
+++ ChangeLog	8 Mar 2004 22:29:18 -0000
@@ -1,5 +1,16 @@
 2004-03-08  Christophe Fergeau  <teuf@gnome.org>
 
+	Based on a patch by The Written Word
+	* configure.in: Detect whether statfs takes 2 or 4 args and if it's 
+	  available
+	  Remove 2 obsolete macro calls
+	* libgnomevfs/gnome-vfs-utils.c: (gnome_vfs_get_volume_free_space):
+          Call the 2-arg/4-arg form of statfs depending on the system we are
+          compiling for, only enable ncpfs specific code on linux.
+	  (fixes bug #136468)
+		    
+2004-03-08  Christophe Fergeau  <teuf@gnome.org>
+
 	* configure.in: properly install ssl-modules.conf when using GNU TLS
 	* libgnomevfs/gnome-vfs-ssl.c: (gnome_vfs_ssl_create_from_fd): fix
 	implicit cast from int to pointer
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gnome-vfs/configure.in,v
retrieving revision 1.252.2.7
diff -u -r1.252.2.7 configure.in
--- configure.in	8 Mar 2004 20:14:12 -0000	1.252.2.7
+++ configure.in	8 Mar 2004 22:29:18 -0000
@@ -38,7 +38,6 @@
 AM_MAINTAINER_MODE
 
 GNOME_COMMON_INIT
-GNOME_PLATFORM_GNOME_2(yes, force)
 
 dnl touch NOINST_GOB
 dnl AC_CONFIG_SUBDIRS(gob)
@@ -105,7 +104,6 @@
 GNOME_COMPILE_WARNINGS
 VFS_CFLAGS="$warnCFLAGS $complCFLAGS"
 
-GNOME_PTHREAD_CHECK
 dnl semaphore functions are in librt.so on solaris
 AC_SEARCH_LIBS(sem_wait, rt)
 
@@ -205,7 +203,62 @@
 AC_SUBST(VFS_SIZE_PRINTF)
 AC_SUBST(VFS_OFFSET_PRINTF)
 
-AC_CHECK_HEADERS(sys/param.h sys/resource.h sys/vfs.h sys/mount.h sys/statvfs.h wctype.h)
+AC_CHECK_HEADERS(sys/param.h sys/resource.h sys/vfs.h sys/mount.h sys/statfs.h sys/statvfs.h wctype.h)
+
+dnl
+dnl file system type member in statfs struct
+dnl
+AC_CHECK_MEMBERS([struct statfs.f_type], ,[
+  AC_CHECK_MEMBERS([struct statfs.f_fstyp], , , [#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif])], [#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif])
+ 
+dnl
+dnl if statfs() takes 2 arguments or 4 (Solaris)
+dnl
+AC_MSG_CHECKING([number of arguments to statfs()])
+AC_TRY_COMPILE([#include <unistd.h>
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif], [struct statfs st;
+statfs(NULL, &st);],[
+  AC_MSG_RESULT([2])
+  AC_DEFINE(STATFS_ARGS, 2, [Number of arguments to statfs()])],[
+  AC_TRY_COMPILE([#include <unistd.h>
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif], [struct statfs st;
+statfs(NULL, &st, sizeof (st), 0);],[
+    AC_MSG_RESULT([4])
+    AC_DEFINE(STATFS_ARGS, 4, [Number of arguments to statfs()])],[
+    AC_MSG_RESULT(unknown)
+    AC_MSG_ERROR([unable to determine number of arguments to statfs()])])])
 
 AC_TYPE_MBSTATE_T
 
Index: libgnomevfs/gnome-vfs-utils.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-utils.c,v
retrieving revision 1.71.2.1
diff -u -r1.71.2.1 gnome-vfs-utils.c
--- libgnomevfs/gnome-vfs-utils.c	15 Nov 2003 14:58:11 -0000	1.71.2.1
+++ libgnomevfs/gnome-vfs-utils.c	8 Mar 2004 22:29:19 -0000
@@ -55,6 +55,9 @@
 #elif HAVE_SYS_MOUNT_H
 #include <sys/mount.h>
 #endif
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
 
 #define KILOBYTE_FACTOR 1024.0
 #define MEGABYTE_FACTOR (1024.0 * 1024.0)
@@ -800,7 +803,12 @@
 #if HAVE_STATVFS
 	statfs_result = statvfs (unescaped_path, &statfs_buffer);
 #else
+#if STATFS_ARGS == 2
 	statfs_result = statfs (unescaped_path, &statfs_buffer);   
+#elif STATFS_ARGS == 4
+	statfs_result = statfs (unescaped_path, &statfs_buffer,
+				sizeof (statfs_buffer), 0);
+#endif
 #endif  
 
 	if (statfs_result != 0) {
@@ -808,6 +816,11 @@
 		return gnome_vfs_result_from_errno ();
 	}
 
+/* CF: I assume ncpfs is linux specific, if you are on a non-linux platform
+ * where ncpfs is available, please file a bug about it on bugzilla.gnome.org
+ * (2004-03-08)
+ */
+#if defined(__linux__)
 	/* ncpfs does not know the amount of available and free space */
 	if (statfs_buffer.f_bavail == 0 && statfs_buffer.f_bfree == 0) {
 		/* statvfs does not return f_type on ncpfs, we try again
@@ -826,6 +839,7 @@
 			return GNOME_VFS_ERROR_NOT_SUPPORTED;
 		}
 	}
+#endif
 
 	block_size = statfs_buffer.f_bsize; 
 	free_blocks = statfs_buffer.f_bavail;
