Przeglądaj źródła

rework the code in cdromutl.cc to make coverity (more) happy

Michael Vogt 13 lat temu
rodzic
commit
fe0036dd7e
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      apt-pkg/contrib/cdromutl.cc

+ 2 - 1
apt-pkg/contrib/cdromutl.cc

@@ -122,8 +122,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)
       {