diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-03-09 12:16:12 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-03-09 12:16:12 +0100 |
commit | 4703608e2ab7549e542410465304078b1ccfa793 (patch) | |
tree | 89ad934ae660a7a9f13b0c3515ca9c3d66ac9c7c /apt-pkg/cdrom.cc | |
parent | 06aca6c3facc4e48d0170fb766b47d919b5258e0 (diff) |
cherry pick (2) from lp:~mvo/apt/mvo
Diffstat (limited to 'apt-pkg/cdrom.cc')
-rw-r--r-- | apt-pkg/cdrom.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 86fe45fbe..1e084bfb5 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -895,8 +895,13 @@ pkgUdevCdromDevices::Scan() /*{{{*/ if (udevice == NULL) continue; const char* devnode = udev_device_get_devnode(udevice); - const char* mountpath = udev_device_get_property_value(udevice, "FSTAB_DIR"); - if (mountpath == NULL) + + // try fstab_dir first + string mountpath; + const char* mp = udev_device_get_property_value(udevice, "FSTAB_DIR"); + if (mp) + mountpath = string(mp); + else mountpath = FindMountPointForDevice(devnode); if (_config->FindB("Debug::Acquire::cdrom", false)) @@ -904,7 +909,7 @@ pkgUdevCdromDevices::Scan() /*{{{*/ // fill in the struct cdrom.DeviceName = string(devnode); - if (mountpath) { + if (mountpath != "") { cdrom.MountPath = mountpath; string s = string(mountpath); cdrom.Mounted = IsMounted(s); |