summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>2009-02-14 16:00:51 -0500
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>2009-02-14 16:01:05 -0500
commit2b097cbb4e83291ffaea0c8904891f031caba898 (patch)
treea81e8bba3707d0d5b26d0f756c2eb1887d75a3dc /source3
parentb222de4eb3abab618f740a89279af2a7dc0985a7 (diff)
downloadsamba-2b097cbb4e83291ffaea0c8904891f031caba898.tar.gz
samba-2b097cbb4e83291ffaea0c8904891f031caba898.tar.bz2
samba-2b097cbb4e83291ffaea0c8904891f031caba898.zip
It seems some systems use f_flags instead of f_flag. Use the appropriate one.
Diffstat (limited to 'source3')
-rw-r--r--source3/configure.in17
-rw-r--r--source3/libsmb/libsmb_stat.c15
2 files changed, 28 insertions, 4 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 97f35113e1..4a8d594dfa 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -4789,6 +4789,23 @@ if test x"$samba_cv_frsize" = x"yes"; then
AC_DEFINE(HAVE_FRSIZE, 1, [Whether statvfs.f_frsize exists])
fi
+# Some systems use f_flag in struct statvfs while others use f_flags
+AC_CACHE_CHECK([that statvfs.statvfs_f_flag works],samba_cv_statvfs_f_flag, [
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/statvfs.h>],[struct statvfs buf; buf.f_flag = 0],
+ samba_cv_statvfs_f_flag=yes,samba_cv_statvfs_f_flag=no)])
+if test x"$samba_cv_statvfs_f_flag" = x"yes"; then
+ AC_DEFINE(HAVE_STATVFS_F_FLAG, 1, [Whether statvfs.f_flag exists])
+fi
+
+AC_CACHE_CHECK([that statvfs.statvfs_f_flags works],samba_cv_statvfs_f_flags, [
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/statvfs.h>],[struct statvfs buf; buf.f_flags = 0],
+ samba_cv_statvfs_f_flags=yes,samba_cv_statvfs_f_flags=no)])
+if test x"$samba_cv_statvfs_f_flags" = x"yes"; then
+ AC_DEFINE(HAVE_STATVFS_F_FLAGS, 1, [Whether statvfs.f_flags exists])
+fi
+
if test $space = no; then
# DEC Alpha running OSF/1
AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c
index 8987c2e38b..8a950b6077 100644
--- a/source3/libsmb/libsmb_stat.c
+++ b/source3/libsmb/libsmb_stat.c
@@ -363,6 +363,7 @@ SMBC_fstatvfs_ctx(SMBCCTX *context,
SMBCFILE *file,
struct statvfs *st)
{
+ unsigned long flags = 0;
uint32 fs_attrs = 0;
struct cli_state *cli = file->srv->cli;
@@ -410,7 +411,7 @@ SMBC_fstatvfs_ctx(SMBCCTX *context,
(fsblkcnt_t) actual_allocation_units;
}
- st->f_flag |= SMBC_VFS_FEATURE_NO_UNIXCIFS;
+ flags |= SMBC_VFS_FEATURE_NO_UNIXCIFS;
} else {
uint32 optimal_transfer_size;
uint32 block_size;
@@ -464,18 +465,24 @@ SMBC_fstatvfs_ctx(SMBCCTX *context,
* user-specified case sensitivity setting.
*/
if (! smbc_getOptionCaseSensitive(context)) {
- st->f_flag |= SMBC_VFS_FEATURE_CASE_INSENSITIVE;
+ flags |= SMBC_VFS_FEATURE_CASE_INSENSITIVE;
}
} else {
if (! (fs_attrs & FILE_CASE_SENSITIVE_SEARCH)) {
- st->f_flag |= SMBC_VFS_FEATURE_CASE_INSENSITIVE;
+ flags |= SMBC_VFS_FEATURE_CASE_INSENSITIVE;
}
}
/* See if DFS is supported */
if ((cli->capabilities & CAP_DFS) && cli->dfsroot) {
- st->f_flag |= SMBC_VFS_FEATURE_DFS;
+ flags |= SMBC_VFS_FEATURE_DFS;
}
+#if HAVE_STATVFS_F_FLAG
+ st->f_flag = flags;
+#elif HAVE_STATVFS_F_FLAGS
+ st->f_flags = flags;
+#endif
+
return 0;
}