r16837: Finally found a Linux version that shows bug 3841. SuSE 7.0 does it :-)
authorVolker Lendecke <vlendec@samba.org>
Thu, 6 Jul 2006 16:59:43 +0000 (16:59 +0000)
committerVolker Lendecke <vlendec@samba.org>
Thu, 6 Jul 2006 16:59:43 +0000 (16:59 +0000)
Attempt to fix it.

Volker

source/configure.in
source/smbd/statvfs.c

index 03f283b59181bceffa2803481e3800fcbfe5d7d2..0365cd3005094be13bdb5ce446b7301713cfba5a 100644 (file)
@@ -4579,6 +4579,16 @@ if test $space = no; then
   fi
 fi
 
+# smbd/statvfs.c assumes that statvfs.f_fsid is an integer.
+# This is not the case on ancient Linux systems.
+
+AC_CACHE_CHECK([that statvfs.f_fsid is an integer],samba_cv_fsid_int, [
+    AC_TRY_COMPILE([#include <sys/statvfs.h>],[struct statvfs buf; buf.f_fsid = 0],
+       samba_cv_fsid_int=yes,samba_cv_fsid_int=no)])
+if test x"$samba_cv_fsid_int" = x"yes"; then
+    AC_DEFINE(HAVE_FSID_INT, 1, [Whether statvfs.f_fsid is an integer])
+fi
+
 if test $space = no; then
   # DEC Alpha running OSF/1
   AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
index 8f981a632888de290da7f1fc22fe081336014bb0..300b14a7c083d43d367d503ec34a6b46e9c495e5 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "includes.h"
 
-#if defined(LINUX)
+#if defined(LINUX) && defined(HAVE_FSID_INT)
 static int linux_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 {
        struct statvfs statvfs_buf;
@@ -51,7 +51,7 @@ static int linux_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 */
 int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 {
-#if defined(LINUX)
+#if defined(LINUX) && defined(HAVE_FSID_INT)
        return linux_statvfs(path, statbuf);
 #else
        /* BB change this to return invalid level */