s3: Test for statfs before statfs64
authorVolker Lendecke <vl@samba.org>
Fri, 2 Mar 2012 01:10:52 +0000 (02:10 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 2 Mar 2012 11:04:34 +0000 (12:04 +0100)
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Mar  2 12:04:35 CET 2012 on sn-devel-104

source3/configure.in

index 6269b4c6d9fb5fa02da9e1eb73a0f80ec3645839..937867dc9a4fa31ed532b8b72d94725d5bafa3f5 100644 (file)
@@ -5240,6 +5240,26 @@ fi
 AC_CHECKING(how to get filesystem space usage)
 space=no
 
+# Perform only the link test since it seems there are no variants of the
+# statvfs function.  This check is more than just AC_CHECK_FUNCS(statvfs)
+# because that got a false positive on SCO OSR5.  Adding the declaration
+# of a `struct statvfs' causes this test to fail (as it should) on such
+# systems.  That system is reported to work fine with STAT_STATFS4 which
+# is what it gets when this test fails.
+if test $space = no; then
+  # SVR4
+  AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
+                [AC_TRY_LINK([#include <sys/types.h>
+#include <sys/statvfs.h>],
+                             [struct statvfs fsd; statvfs (0, &fsd);],
+                             fu_cv_sys_stat_statvfs=yes,
+                             fu_cv_sys_stat_statvfs=no)])
+  if test $fu_cv_sys_stat_statvfs = yes; then
+    space=yes
+    AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available])
+  fi
+fi
+
 # Test for statvfs64.
 if test $space = no; then
   # SVR4
@@ -5264,26 +5284,6 @@ if test $space = no; then
   fi
 fi
 
-# Perform only the link test since it seems there are no variants of the
-# statvfs function.  This check is more than just AC_CHECK_FUNCS(statvfs)
-# because that got a false positive on SCO OSR5.  Adding the declaration
-# of a `struct statvfs' causes this test to fail (as it should) on such
-# systems.  That system is reported to work fine with STAT_STATFS4 which
-# is what it gets when this test fails.
-if test $space = no; then
-  # SVR4
-  AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
-                [AC_TRY_LINK([#include <sys/types.h>
-#include <sys/statvfs.h>],
-                             [struct statvfs fsd; statvfs (0, &fsd);],
-                             fu_cv_sys_stat_statvfs=yes,
-                             fu_cv_sys_stat_statvfs=no)])
-  if test $fu_cv_sys_stat_statvfs = yes; then
-    space=yes
-    AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available])
-  fi
-fi
-
 # smbd/statvfs.c assumes that statvfs.f_fsid is an integer.
 # This is not the case on ancient Linux systems.