summaryrefslogtreecommitdiff
path: root/methods/cdrom.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-01-26 20:36:13 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2010-01-26 20:36:13 +0100
commitfb503892e3e05132bb7db369440402ff81ea5f8d (patch)
tree40b4217529f797086bfef402431eb9397ec0553e /methods/cdrom.cc
parent169413dcf101ca39aebc2bf46991c27c1e439259 (diff)
* cmdline/apt-cdrom.cc:
- fixed signed/unsigned warning - create /media mount point if needed - fix initialization for res in DoAdd() * methods/cdrom.cc: - make AptMountPoint a variable
Diffstat (limited to 'methods/cdrom.cc')
-rw-r--r--methods/cdrom.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/methods/cdrom.cc b/methods/cdrom.cc
index 0e78851ff..c8ec322ee 100644
--- a/methods/cdrom.cc
+++ b/methods/cdrom.cc
@@ -116,23 +116,24 @@ bool CDROMMethod::AutoDetectAndMount(URI Get, string &NewID)
return false;
// check if we have the mount point
- if (!FileExists("/media/apt"))
- mkdir("/media/apt", 0755);
+ const char* AptMountPoint = "/media/apt";
+ if (!FileExists(AptMountPoint))
+ mkdir(AptMountPoint, 0750);
// now try mounting
for (unsigned int i=0; i < v.size(); i++)
{
if (!v[i].Mounted)
{
- if(MountCdrom("/media/apt", v[i].DeviceName))
+ if(MountCdrom(AptMountPoint, v[i].DeviceName))
{
- if (IsCorrectCD(Get, "/media/apt", NewID))
+ if (IsCorrectCD(Get, AptMountPoint, NewID))
{
MountedByApt = true;
- CDROM = "/media/apt";
+ CDROM = AptMountPoint;
return true;
} else {
- UnmountCdrom("/media/apt");
+ UnmountCdrom(AptMountPoint);
}
}
}