From a455d9e65d6725067317ee0176275c2e18d9a16b Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 19 Nov 2009 14:32:51 +0100 Subject: [SMB] Fix compilation with older libsmbclient versions Actually check for smbc_getFunctionStatVFS() presence. Unfortunately smbclient pkg-config files still report version 0. Fixes bug 602323. (cherry picked from commit e7c997882e656751f021c65c2ce71739cf12f585) --- configure.ac | 2 ++ daemon/gvfsbackendsmb.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 0bc7ce4e..d84a45c6 100644 --- a/configure.ac +++ b/configure.ac @@ -470,6 +470,8 @@ if test "x$enable_samba" != "xno"; then else SAMBA_LIBS="-lsmbclient" fi + AC_CHECK_LIB(smbclient, smbc_getFunctionStatVFS, + AC_DEFINE(HAVE_SAMBA_STAT_VFS, , [Define to 1 if smbclient supports smbc_stat_fn])) else AC_CHECK_LIB(smbclient, smbc_new_context,samba_old_libs="yes", samba_old_libs="no") if test "x${samba_old_libs}" != "xno"; then diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c index 37c6c201..f53b8cb4 100644 --- a/daemon/gvfsbackendsmb.c +++ b/daemon/gvfsbackendsmb.c @@ -1592,14 +1592,15 @@ do_query_fs_info (GVfsBackend *backend, GFileAttributeMatcher *attribute_matcher) { GVfsBackendSmb *op_backend = G_VFS_BACKEND_SMB (backend); + + g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "cifs"); + +#ifdef HAVE_SAMBA_STAT_VFS smbc_statvfs_fn smbc_statvfs; struct statvfs st = {0}; char *uri; int res; - g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "cifs"); - -#ifdef DEPRECATED_SMBC_INTERFACE if (g_file_attribute_matcher_matches (attribute_matcher, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) || g_file_attribute_matcher_matches (attribute_matcher, -- cgit v1.2.1