diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-07-23 10:41:38 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-07-23 10:41:38 +0200 |
commit | 3e2d7cce4febc923d4b9bcb363717dd161cbb856 (patch) | |
tree | 69245f40f2623ccb7bb914aba06e17d009a9689a /apt-pkg/contrib/cdromutl.cc | |
parent | 47f1d6d23c344b4c592565cc1ea61b5456570a06 (diff) | |
parent | 76fe5db7153957f8fda437e3bd614312b076f19e (diff) |
[ABI] merged the libudev-dlopen branch, this allows to pass
"apt-udev-auto" to Acquire::Cdrom::mount and the cdrom method will
dynamically find/mount the cdrom device (if libhal is available)
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 b6524a178..0cf9697ac 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); } |