diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-07-22 18:01:43 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-07-22 18:01:43 +0200 |
commit | a6418a4b93376e0e4acf36e88eb1d0ec41e024df (patch) | |
tree | 9c6b5936266036735bde19f2a13a53bc396dc577 /apt-pkg/contrib/cdromutl.cc | |
parent | be5b558134ade780e11f50dede99d041a1defd7f (diff) | |
download | apt-a6418a4b93376e0e4acf36e88eb1d0ec41e024df.tar.gz |
* methods/cdrom.cc:
- add Acquire::Cdrom::mount "apt-udev-auto" magic to allow
dynamically finding the cdrom device
* apt-pkg/contrib/cdromutl.{h,cc}:
- support additional (optional) DeviceName parameter for MountCdrom()
Diffstat (limited to 'apt-pkg/contrib/cdromutl.cc')
-rw-r--r-- | apt-pkg/contrib/cdromutl.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc index b6524a17..0cf9697a 100644 --- a/apt-pkg/contrib/cdromutl.cc +++ b/apt-pkg/contrib/cdromutl.cc @@ -98,7 +98,7 @@ bool UnmountCdrom(string Path) // MountCdrom - Mount a cdrom /*{{{*/ // --------------------------------------------------------------------- /* We fork mount and drop all messages */ -bool MountCdrom(string Path) +bool MountCdrom(string Path, string DeviceName) { if (IsMounted(Path) == true) return true; @@ -122,8 +122,15 @@ bool MountCdrom(string Path) { const char *Args[10]; Args[0] = "mount"; - Args[1] = Path.c_str(); - Args[2] = 0; + if (DeviceName == "") + { + Args[1] = Path.c_str(); + Args[2] = 0; + } else { + Args[1] = DeviceName.c_str(); + Args[2] = Path.c_str(); + Args[3] = 0; + } execvp(Args[0],(char **)Args); _exit(100); } |