summaryrefslogtreecommitdiff
path: root/apt-pkg/cdrom.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-03-09 12:15:13 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-03-09 12:15:13 +0100
commit02aa6f67360bbd8f15c29fb0701badda99fc8c75 (patch)
treec6c8c614e050c83fb7e4637f2e1b6e05caf717ab /apt-pkg/cdrom.cc
parentf4c4a24ea1cd8711c186c1c60b43f0bf0bc8af10 (diff)
downloadapt-02aa6f67360bbd8f15c29fb0701badda99fc8c75.tar.gz
apt-pkg/contrib/cdromutl.{cc,h}: return string for mountpath; apt-pkg/cdrom.cc: use string
Diffstat (limited to 'apt-pkg/cdrom.cc')
-rw-r--r--apt-pkg/cdrom.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index deca6b4ac..83438f1c4 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -907,13 +907,18 @@ pkgUdevCdromDevices::ScanForRemovable(bool CdromOnly)
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);
// fill in the struct
cdrom.DeviceName = string(devnode);
- if (mountpath) {
+ if (mountpath != "") {
cdrom.MountPath = mountpath;
string s = string(mountpath);
cdrom.Mounted = IsMounted(s);