X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/71ecaad29d8066a494f516efc5efd80860653fe2..a02db58fd50ef7fc2f0284852c6b3f98e458a232:/apt-pkg/contrib/cdromutl.cc diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc index 187f6bd59..096d3bcf5 100644 --- a/apt-pkg/contrib/cdromutl.cc +++ b/apt-pkg/contrib/cdromutl.cc @@ -19,7 +19,10 @@ #include #include -#include +#include +#include +#include +#include #include #include #include @@ -47,8 +50,8 @@ bool IsMounted(string &Path) if (Path[Path.length() - 1] != '/') Path += '/'; - /* First we check if the path is actualy mounted, we do this by - stating the path and the previous directory (carefull of links!) + /* First we check if the path is actually mounted, we do this by + stating the path and the previous directory (careful of links!) and comparing their device fields. */ struct stat Buf,Buf2; if (stat(Path.c_str(),&Buf) != 0 || @@ -122,8 +125,9 @@ bool MountCdrom(string Path, string DeviceName) if (Child == 0) { // Make all the fds /dev/null + int null_fd = open("/dev/null",O_RDWR); for (int I = 0; I != 3; I++) - dup2(open("/dev/null",O_RDWR),I); + dup2(null_fd, I); if (_config->Exists("Acquire::cdrom::"+Path+"::Mount") == true) {