Michael Vogt лет назад: 12
Родитель
Сommit
61f954bff0
4 измененных файлов с 8 добавлено и 2 удалено
  1. 1 1
      apt-pkg/algorithms.h
  2. 2 1
      apt-pkg/contrib/fileutl.cc
  3. 4 0
      apt-pkg/install-progress.cc
  4. 1 0
      debian/changelog

+ 1 - 1
apt-pkg/algorithms.h

@@ -40,11 +40,11 @@
 
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/acquire.h>
-// include pkg{DistUpgrade,AllUpgrade,MiniizeUpgrade} here for compatiblity
 using std::ostream;
 #endif
 
 #ifndef APT_9_CLEANER_HEADERS
+// include pkg{DistUpgrade,AllUpgrade,MiniizeUpgrade} here for compatiblity
 #include <apt-pkg/upgrade.h>
 #include <apt-pkg/update.h>
 #endif

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

@@ -769,6 +769,7 @@ pid_t ExecFork()
 {
       set<int> KeepFDs;
 
+      // FIXME: remove looking at APT::Keep-Fds eventually, its a hack
       Configuration::Item const *Opts = _config->Tree("APT::Keep-Fds");
       if (Opts != 0 && Opts->Child != 0)
       {
@@ -806,7 +807,7 @@ pid_t ExecFork(std::set<int> KeepFDs)
       signal(SIGTSTP,SIG_DFL);
 
       // Close all of our FDs - just in case
-      for (int K = 3; K != 40; K++)
+      for (int K = 3; K != sysconf(_SC_OPEN_MAX); K++)
       {
 	 if(KeepFDs.find(K) == KeepFDs.end())
 	    fcntl(K,F_SETFD,FD_CLOEXEC);

+ 4 - 0
apt-pkg/install-progress.cc

@@ -13,6 +13,10 @@
 namespace APT {
 namespace Progress {
 
+
+/* Return a APT::Progress::PackageManager based on the global
+ * apt configuration (i.e. APT::Status-Fd and APT::Status-deb822-Fd)
+ */
 PackageManager* PackageManagerProgressFactory()
 {
    // select the right progress

+ 1 - 0
debian/changelog

@@ -19,6 +19,7 @@ apt (0.9.13~exp1) experimental; urgency=low
   * prepare next ABI via #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
   * add new pid_t ExecFork(std::set<int> KeepFDs)
   * Avoid flickering when "apt-get -o DpkgPM::Progress-Fancy=1" is use
+  * use sysconf(_SC_OPEN_MAX) in ExecFork()
 
  -- Michael Vogt <mvo@debian.org>  Fri, 01 Nov 2013 10:03:06 +0100