The branch, master has been updated
       via  f4a1893 s3:build: tell linker to use corefoundation on all darwin 
releases
       via  b526a0d s3: merge bsd_statvfs and darwin_statvfs
      from  f3862b9 ccan: we're subsystems, not a library.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f4a189392c17f5992a7c04aae6f6c2134fe49828
Author: Björn Jacke <b...@sernet.de>
Date:   Fri Jun 29 12:49:21 2012 +0200

    s3:build: tell linker to use corefoundation on all darwin releases
    
    Autobuild-User(master): Björn Jacke <b...@sernet.de>
    Autobuild-Date(master): Fri Jun 29 14:43:39 CEST 2012 on sn-devel-104

commit b526a0d6730796057c5486bf07fbb6b1b79c92b4
Author: Björn Jacke <b...@sernet.de>
Date:   Thu Jun 28 21:34:40 2012 +0200

    s3: merge bsd_statvfs and darwin_statvfs

-----------------------------------------------------------------------

Summary of changes:
 source3/configure.in   |    4 +-
 source3/smbd/statvfs.c |   84 +++++++++++++++++------------------------------
 2 files changed, 33 insertions(+), 55 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/configure.in b/source3/configure.in
index ba376f0..e08ac16 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -635,9 +635,9 @@ 
AC_CHECK_HEADERS([CoreFoundation/CFStringEncodingConverter.h], [], [AC_CHECK_HEA
 CPPFLAGS="$old_CPPFLAGS"
 
 # To link lib/util/charset/charset_macosxfs.c, we need to tell the linker
-# about CoreFoundation, at least on os X 10.6 and 10.7
+# about CoreFoundation, at least on os X 10.4..10.7 resp. darwin8..12
 case "$host_os" in
-    *darwin11*|*darwin10*)
+    *darwin*)
                LDFLAGS="$LDFLAGS -framework CoreFoundation"
        ;;
 esac
diff --git a/source3/smbd/statvfs.c b/source3/smbd/statvfs.c
index 918867f..f343595 100644
--- a/source3/smbd/statvfs.c
+++ b/source3/smbd/statvfs.c
@@ -24,7 +24,6 @@
 #include "smbd/smbd.h"
 
 #if defined(DARWINOS)
-
 #include <sys/attr.h>
 
 static int darwin_fs_capabilities(const char * path)
@@ -74,65 +73,46 @@ static int darwin_fs_capabilities(const char * path)
 
        return caps;
 }
+#endif /* DARWINOS */
 
-static int darwin_statvfs(const char *path, vfs_statvfs_struct *statbuf)
+#if defined(BSD_STYLE_STATVFS)
+static int bsd_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 {
        struct statfs sbuf;
        int ret;
 
        ret = statfs(path, &sbuf);
        if (ret != 0) {
-               return ret;
-       }
-
-       statbuf->OptimalTransferSize = sbuf.f_iosize;
-       statbuf->BlockSize = sbuf.f_bsize;
-       statbuf->TotalBlocks = sbuf.f_blocks;
-       statbuf->BlocksAvail = sbuf.f_bfree;
-       statbuf->UserBlocksAvail = sbuf.f_bavail;
-       statbuf->TotalFileNodes = sbuf.f_files;
-       statbuf->FreeFileNodes = sbuf.f_ffree;
-       statbuf->FsIdentifier = *(uint64_t *)(&sbuf.f_fsid); /* Ick. */
-       statbuf->FsCapabilities = darwin_fs_capabilities(sbuf.f_mntonname);
-
-       return 0;
-}
-#elif defined(BSD_STYLE_STATVFS)
-static int bsd_statvfs(const char *path, vfs_statvfs_struct *statbuf)
-{
-       struct statfs statfs_buf;
-       int result;
-
-       result = statfs(path, &statfs_buf);
-       if (result != 0) {
-               return result;
-       }
-
-       statbuf->OptimalTransferSize = statfs_buf.f_iosize;
-       statbuf->BlockSize = statfs_buf.f_bsize;
-       statbuf->TotalBlocks = statfs_buf.f_blocks;
-       statbuf->BlocksAvail = statfs_buf.f_bfree;
-       statbuf->UserBlocksAvail = statfs_buf.f_bavail;
-       statbuf->TotalFileNodes = statfs_buf.f_files;
-       statbuf->FreeFileNodes = statfs_buf.f_ffree;
-       statbuf->FsIdentifier =
-               (((uint64_t) statfs_buf.f_fsid.val[0] << 32) & 
0xffffffff00000000LL) |
-                   (uint64_t) statfs_buf.f_fsid.val[1];
-       /* Try to extrapolate some of the fs flags into the
-        * capabilities
-        */
-       statbuf->FsCapabilities =
-           FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
+               statbuf->OptimalTransferSize = sbuf.f_iosize;
+               statbuf->BlockSize = sbuf.f_bsize;
+               statbuf->TotalBlocks = sbuf.f_blocks;
+               statbuf->BlocksAvail = sbuf.f_bfree;
+               statbuf->UserBlocksAvail = sbuf.f_bavail;
+               statbuf->TotalFileNodes = sbuf.f_files;
+               statbuf->FreeFileNodes = sbuf.f_ffree;
+               statbuf->FsIdentifier =
+                       (((uint64_t) sbuf.f_fsid.val[0] << 32) & 
0xffffffff00000000LL) |
+                           (uint64_t) sbuf.f_fsid.val[1];
+#ifdef DARWINOS
+               statbuf->FsCapabilities = 
darwin_fs_capabilities(sbuf.f_mntonname);
+#else
+               /* Try to extrapolate some of the fs flags into the
+                * capabilities
+                */
+               statbuf->FsCapabilities =
+                   FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
 #ifdef MNT_ACLS
-       if (statfs_buf.f_flags & MNT_ACLS)
-               statbuf->FsCapabilities |= FILE_PERSISTENT_ACLS;
+               if (sbuf.f_flags & MNT_ACLS)
+                       statbuf->FsCapabilities |= FILE_PERSISTENT_ACLS;
 #endif
-       if (statfs_buf.f_flags & MNT_QUOTA)
-               statbuf->FsCapabilities |= FILE_VOLUME_QUOTAS;
-       if (statfs_buf.f_flags & MNT_RDONLY)
-               statbuf->FsCapabilities |= FILE_READ_ONLY_VOLUME;
+               if (sbuf.f_flags & MNT_QUOTA)
+                       statbuf->FsCapabilities |= FILE_VOLUME_QUOTAS;
+               if (sbuf.f_flags & MNT_RDONLY)
+                       statbuf->FsCapabilities |= FILE_READ_ONLY_VOLUME;
+#endif
+       }
 
-       return 0;
+       return ret;
 }
 #elif defined(STAT_STATVFS) && defined(HAVE_FSID_INT)
 static int linux_statvfs(const char *path, vfs_statvfs_struct *statbuf)
@@ -175,9 +155,7 @@ static int linux_statvfs(const char *path, 
vfs_statvfs_struct *statbuf)
 */
 int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 {
-#if defined(DARWINOS)
-       return darwin_statvfs(path, statbuf);
-#elif defined(BSD_STYLE_STATVFS)
+#if defined(BSD_STYLE_STATVFS)
        return bsd_statvfs(path, statbuf);
 #elif defined(STAT_STATVFS) && defined(HAVE_FSID_INT)
        return linux_statvfs(path, statbuf);


-- 
Samba Shared Repository

Reply via email to