[glib] glocalfile: Fix compilation without USE_STATFS and USE_STATVFS



commit a5e94cbd36304ac48e20599ad39fd4bfbd6a5cbe
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jul 21 02:56:05 2011 +0200

    glocalfile: Fix compilation without USE_STATFS and USE_STATVFS

 gio/glocalfile.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gio/glocalfile.c b/gio/glocalfile.c
index b246af3..4143fbe 100644
--- a/gio/glocalfile.c
+++ b/gio/glocalfile.c
@@ -900,11 +900,12 @@ g_local_file_query_filesystem_info (GFile         *file,
   int statfs_result = 0;
   gboolean no_size;
 #ifndef G_OS_WIN32
-  guint64 block_size;
   const char *fstype;
 #ifdef USE_STATFS
+  guint64 block_size;
   struct statfs statfs_buffer;
 #elif defined(USE_STATVFS)
+  guint64 block_size;
   struct statvfs statfs_buffer;
 #endif
 #endif
@@ -967,8 +968,10 @@ g_local_file_query_filesystem_info (GFile         *file,
         g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_FREE, (guint64)li.QuadPart);
       g_free (wdirname);
 #else
+#if defined(USE_STATFS) || defined(USE_STATVFS)
       g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_FREE, block_size * statfs_buffer.f_bavail);
 #endif
+#endif
     }
   if (!no_size &&
       g_file_attribute_matcher_matches (attribute_matcher,
@@ -984,8 +987,10 @@ g_local_file_query_filesystem_info (GFile         *file,
         g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE,  (guint64)li.QuadPart);
       g_free (wdirname);
 #else
+#if defined(USE_STATFS) || defined(USE_STATVFS)
       g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE, block_size * statfs_buffer.f_blocks);
 #endif
+#endif
     }
 #ifdef USE_STATFS
 #if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME)
@@ -996,6 +1001,8 @@ g_local_file_query_filesystem_info (GFile         *file,
 
 #elif defined(USE_STATVFS) && defined(HAVE_STRUCT_STATVFS_F_BASETYPE)
   fstype = g_strdup(statfs_buffer.f_basetype); 
+#else
+  fstype = NULL;
 #endif
 
 #ifndef G_OS_WIN32



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]