mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-08 18:36:17 +01:00
Merge branch '328-file-system-full' into 'master'
Resolve "filesystem::{free,size,used} not set for full FAT fs" Closes #328 See merge request GNOME/glib!163
This commit is contained in:
commit
b0278604f8
@ -983,15 +983,20 @@ g_local_file_query_filesystem_info (GFile *file,
|
||||
block_size = statfs_buffer.f_bsize;
|
||||
|
||||
/* 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 available == 0 and
|
||||
free == 0 case as "both of these are invalid".
|
||||
*/
|
||||
#ifndef G_OS_WIN32
|
||||
* backend for backend not supporting this), and set f_bfree to 0,
|
||||
* but it can be 0 for real too. We treat the available == 0 and
|
||||
* free == 0 case as "both of these are invalid", but only on file systems
|
||||
* which are known to not support this (otherwise we can omit metadata for
|
||||
* systems which are legitimately full). */
|
||||
#if defined(__linux__)
|
||||
if (statfs_result == 0 &&
|
||||
statfs_buffer.f_bavail == 0 && statfs_buffer.f_bfree == 0)
|
||||
statfs_buffer.f_bavail == 0 && statfs_buffer.f_bfree == 0 &&
|
||||
(/* linux/ncp_fs.h: NCP_SUPER_MAGIC == 0x564c */
|
||||
statfs_buffer.f_type == 0x564c ||
|
||||
/* man statfs: FUSE_SUPER_MAGIC == 0x65735546 */
|
||||
statfs_buffer.f_type == 0x65735546))
|
||||
no_size = TRUE;
|
||||
#endif /* G_OS_WIN32 */
|
||||
#endif /* __linux__ */
|
||||
|
||||
#elif defined(USE_STATVFS)
|
||||
statfs_result = statvfs (local->filename, &statfs_buffer);
|
||||
|
Loading…
Reference in New Issue
Block a user