s3: fine tune and clean up statvfs tests
authorBjörn Jacke <bj@sernet.de>
Thu, 28 Jun 2012 19:17:28 +0000 (21:17 +0200)
committerBjoern Jacke <bj@sernet.de>
Thu, 28 Jun 2012 21:07:23 +0000 (23:07 +0200)
This should also fix the build on Tru64. Tru64 has a POSIX compliant statvfs()
function while most *BSD systems ignore POSIX.

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu Jun 28 23:07:23 CEST 2012 on sn-devel-104

source3/configure.in
source3/smbd/statvfs.c

index 6e324a16a0278c9ee8fdf5e22d6d94285d33ffaa..5df54cfff9dd04ace89ba409cf54b536b8de9cf8 100644 (file)
@@ -6261,11 +6261,11 @@ fi
 
 CFLAGS=$CFLAGS_SAVE
 
-# Checks for *BSD bsd_statvfs() function
+# Checks for POSIX ignorant BSD style statvfs() function
 # Start
 AC_CHECK_HEADERS(sys/param.h sys/mount.h)
 
-AC_MSG_CHECKING([bsd_statvfs: checking for statfs() and struct statfs.bsize])
+AC_MSG_CHECKING([checking for posix ignorant *bsd style statfs struct])
 AC_CACHE_VAL(bsdstatvfs_cv_statfs,[
             AC_TRY_RUN([
                #ifdef HAVE_SYS_PARAM_H
@@ -6278,7 +6278,8 @@ AC_CACHE_VAL(bsdstatvfs_cv_statfs,[
                {
                        struct statfs fsd;
                        fsd.f_bsize = 0;
-                       exit (statfs (".", &fsd));
+                       fsd.f_iosize = 0;
+                       return (statfs (".", &fsd));
                }],
                bsdstatvfs_cv_statfs=yes,
                bsdstatvfs_cv_statfs=no,
@@ -6286,11 +6287,9 @@ AC_CACHE_VAL(bsdstatvfs_cv_statfs,[
 AC_MSG_RESULT($bsdstatvfs_cv_statfs)
 
 if test $bsdstatvfs_cv_statfs = yes; then
-  AC_DEFINE(BSD_STATVFS_BSIZE,1,[Whether statfs exists and struct statfs has bsize property])
+  AC_DEFINE(BSD_STYLE_STATVFS,1,[Whether statfs struct is *bsd style])
 fi
-
-# End
-# Checks for *BSD sys_statvfs() function
+# End of checks POSIX ignorant BSD style statvfs() function
 
 # Checks for the vfs_fileid module
 # Start
index 5cefe2d4c23031bca62d0a3b2753eec479a7d1ab..918867f7aad4c8253247ee9298a1241158dde5c7 100644 (file)
@@ -97,7 +97,7 @@ static int darwin_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 
        return 0;
 }
-#elif defined(BSD) && defined(BSD_STATVFS_BSIZE)
+#elif defined(BSD_STYLE_STATVFS)
 static int bsd_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 {
        struct statfs statfs_buf;
@@ -177,7 +177,7 @@ int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 {
 #if defined(DARWINOS)
        return darwin_statvfs(path, statbuf);
-#elif defined(BSD) && defined(BSD_STATVFS_BSIZE)
+#elif defined(BSD_STYLE_STATVFS)
        return bsd_statvfs(path, statbuf);
 #elif defined(STAT_STATVFS) && defined(HAVE_FSID_INT)
        return linux_statvfs(path, statbuf);