diff --git a/gio/glocalfile.c b/gio/glocalfile.c index 354ac7c8c..11a201ac1 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -1677,20 +1677,16 @@ find_mountpoint_for (const char *file, } } -static char * -_g_local_file_find_topdir_for_internal (const char *file, dev_t file_dev) +char * +_g_local_file_find_topdir_for (const char *file) { char *dir; char *mountpoint = NULL; dev_t dir_dev; dir = get_parent (file, &dir_dev); - if (dir == NULL || dir_dev != file_dev) - { - g_free (dir); - - return NULL; - } + if (dir == NULL) + return NULL; mountpoint = find_mountpoint_for (dir, dir_dev); g_free (dir); @@ -1698,17 +1694,6 @@ _g_local_file_find_topdir_for_internal (const char *file, dev_t file_dev) return mountpoint; } -char * -_g_local_file_find_topdir_for (const char *file) -{ - GStatBuf file_stat; - - if (g_lstat (file, &file_stat) != 0) - return NULL; - - return _g_local_file_find_topdir_for_internal (file, file_stat.st_dev); -} - static char * get_unique_filename (const char *basename, int id) @@ -1962,8 +1947,7 @@ g_local_file_trash (GFile *file, uid = geteuid (); g_snprintf (uid_str, sizeof (uid_str), "%lu", (unsigned long)uid); - topdir = _g_local_file_find_topdir_for_internal (local->filename, - file_stat.st_dev); + topdir = _g_local_file_find_topdir_for (local->filename); if (topdir == NULL) { g_set_io_error (error, diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c index 9cf7ff845..58802fd43 100644 --- a/gio/glocalfileinfo.c +++ b/gio/glocalfileinfo.c @@ -924,13 +924,9 @@ get_access_rights (GFileAttributeMatcher *attribute_matcher, _g_file_info_set_attribute_boolean_by_id (info, G_FILE_ATTRIBUTE_ID_ACCESS_CAN_DELETE, writable); - /* Trashing is supported only if the parent device is the same */ if (_g_file_attribute_matcher_matches_id (attribute_matcher, G_FILE_ATTRIBUTE_ID_ACCESS_CAN_TRASH)) - _g_file_info_set_attribute_boolean_by_id (info, - G_FILE_ATTRIBUTE_ID_ACCESS_CAN_TRASH, - writable && - parent_info->has_trash_dir && - parent_info->device == statbuf->st_dev); + _g_file_info_set_attribute_boolean_by_id (info, G_FILE_ATTRIBUTE_ID_ACCESS_CAN_TRASH, + writable && parent_info->has_trash_dir); } }