mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
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).
This commit is contained in:
@@ -36,6 +36,7 @@ typedef struct
|
||||
gboolean has_trash_dir;
|
||||
int owner;
|
||||
dev_t device;
|
||||
ino_t inode;
|
||||
gpointer extra_data;
|
||||
GDestroyNotify free_extra_data;
|
||||
} GLocalParentFileInfo;
|
||||
|
Reference in New Issue
Block a user