diff options
author | Will Thompson <will@willthompson.co.uk> | 2018-06-01 15:43:27 +0100 |
---|---|---|
committer | Will Thompson <will@willthompson.co.uk> | 2018-06-07 06:38:23 +0100 |
commit | 0c5f084200bd9667d1c73b03e9e0482cc2384a93 (patch) | |
tree | ab89b003f6947f8618dbe086d63ca30c366d8443 /gio/gfileinfo.h | |
parent | e0f82b949449d6bed857abe58c108d923f919b7c (diff) | |
download | glib-0c5f084200bd9667d1c73b03e9e0482cc2384a93.tar.gz |
fileinfo: make UNIX_IS_MOUNTPOINT be TRUE for /
The previously implementation considered a file to be a mountpoint if
its parent is on a different device. / is its own parent, so by this
definition it is not a mountpoint.
But / is (generally) listed in fstab, and fstab(5) defines the
directories it contains to be mountpoints. This attribute should follow
that definition (and reasonable expectation): the root directory is a
mountpoint.
So, add a special-case for the case where the file's parent has the same
st_dev and st_ino as the file, which is true only at the root.
Test this attribute at / (only on POSIX), /proc (but only on Linux), and
at many files and directories created by the test suite (which cannot be
mountpoints).
Diffstat (limited to 'gio/gfileinfo.h')
-rw-r--r-- | gio/gfileinfo.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gio/gfileinfo.h b/gio/gfileinfo.h index 4decee346..8416b4fad 100644 --- a/gio/gfileinfo.h +++ b/gio/gfileinfo.h @@ -644,7 +644,8 @@ typedef struct _GFileInfoClass GFileInfoClass; * * A key in the "unix" namespace for checking if the file represents a * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount - * point. This attribute is only available for UNIX file systems. + * point. Since 2.58, `/` is considered to be a mount point. + * This attribute is only available for UNIX file systems. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN. **/ #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */ |