Преглед изворни кода

don't leak EDSP solver output fd

David Kalnischkies пре 10 година
родитељ
комит
2202a8a057
2 измењених фајлова са 4 додато и 3 уклоњено
  1. 1 1
      apt-pkg/edsp.cc
  2. 3 2
      apt-pkg/edsp.h

+ 1 - 1
apt-pkg/edsp.cc

@@ -625,7 +625,7 @@ bool EDSP::ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progres
 	}
 
 	FileFd in;
-	in.OpenDescriptor(input, FileFd::ReadOnly);
+	in.OpenDescriptor(input, FileFd::ReadOnly, true);
 	pkgTagFile response(&in, 100);
 	pkgTagSection section;
 

+ 3 - 2
apt-pkg/edsp.h

@@ -109,8 +109,9 @@ namespace EDSP								/*{{{*/
 	 *
 	 *  This method takes care of interpreting whatever the solver sends
 	 *  through the standard output like a solution, progress or an error.
-	 *  The main thread should handle his control over to this method to
-	 *  wait for the solver to finish the given task
+	 *  The main thread should hand his control over to this method to
+	 *  wait for the solver to finish the given task. The file descriptor
+	 *  used as input is completely consumed and closed by the method.
 	 *
 	 *  \param input file descriptor with the response from the solver
 	 *  \param Cache the solution should be applied on if any