Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
coreutils.669
coreutils-look_for_accessible_mount_points_for_...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File coreutils-look_for_accessible_mount_points_for_specified_devices.patch of Package coreutils.669
commit 828801a174de8fa6e492f311210c37394f13b30f Author: Pádraig Brady <P@draigBrady.com> Date: Wed Jun 18 13:10:17 2014 +0100 df: look for accessible mount points for specified devices * src/df.c (get_disk): Include whether we can access the mount dir, in the mount entry selection criteria. This handles the case where a device is (bind) mounted multiple times with the shortest mount path not being accessible, while some of the other mount points are. Discussed at: http://bugs.gnu.org/16539#63 diff --git a/src/df.c b/src/df.c index d6d4b0e..dc6544b 100644 --- a/src/df.c +++ b/src/df.c @@ -1121,6 +1121,7 @@ get_disk (char const *disk) { struct mount_entry const *me; struct mount_entry const *best_match = NULL; + bool best_match_accessible = false; char const *file = disk; char *resolved = canonicalize_file_name (disk); @@ -1139,13 +1140,24 @@ get_disk (char const *disk) if (STREQ (disk, devname)) { size_t len = strlen (me->me_mountdir); - if (len < best_match_len) + + if (! best_match_accessible || len < best_match_len) { - best_match = me; - if (len == 1) /* Traditional root. */ - break; - else - best_match_len = len; + struct stat disk_stats; + bool this_match_accessible = false; + + if (stat (me->me_mountdir, &disk_stats) == 0) + best_match_accessible = this_match_accessible = true; + + if (this_match_accessible + || (! best_match_accessible && len < best_match_len)) + { + best_match = me; + if (len == 1) /* Traditional root. */ + break; + else + best_match_len = len; + } } }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor