From 0b9f24c1e15254da8e105c88290b4d53976e6d0e Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 3 Mar 2009 14:40:44 +0000 Subject: [PATCH] Handle filesystems no supporting reporting how much is free. This fixes 2009-03-03 Alexander Larsson * glocalfile.c (g_local_file_query_filesystem_info): Handle filesystems no supporting reporting how much is free. This fixes bug 573454 where the filesystem not supporting this is the gvfs smb backend over the fuse filesystem. svn path=/trunk/; revision=7951 --- gio/ChangeLog | 7 +++++++ gio/glocalfile.c | 13 ++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index 8e009fdb9..c9f726908 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,10 @@ +2009-03-03 Alexander Larsson + + * glocalfile.c (g_local_file_query_filesystem_info): + Handle filesystems no supporting reporting how much is free. + This fixes bug 573454 where the filesystem not supporting this + is the gvfs smb backend over the fuse filesystem. + 2009-03-02 Matthias Clasen * === Released 2.19.10 === diff --git a/gio/glocalfile.c b/gio/glocalfile.c index 41de4eade..217ee988c 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -957,14 +957,13 @@ g_local_file_query_filesystem_info (GFile *file, #endif block_size = statfs_buffer.f_bsize; -#if defined(__linux__) - /* ncpfs does not know the amount of available and free space * - * assuming ncpfs is linux specific, if you are on a non-linux platform - * where ncpfs is available, please file a bug about it on bugzilla.gnome.org + /* Many backends can't report free size (for instance the gvfs fuse + backend for backend not supporting this), and set f_bfree to 0, + but it can be 0 for real too. We treat the availible == 0 and + free == 0 case as "both of these are invalid". */ - if (statfs_buffer.f_bavail == 0 && statfs_buffer.f_bfree == 0 && - /* linux/ncp_fs.h: NCP_SUPER_MAGIC == 0x564c */ - statfs_buffer.f_type == 0x564c) +#ifndef G_OS_WIN32 + if (statfs_buffer.f_bavail == 0 && statfs_buffer.f_bfree == 0) no_size = TRUE; #endif