]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/dpkgpm.cc
* deb/dpkgpm.cc:
[apt.git] / apt-pkg / deb / dpkgpm.cc
index 395c3fb1aed6da42338b556fa99688a31ef645bc..3b10e1a23eaadcf8b943c7a1db192d94c751c253 100644 (file)
@@ -322,7 +322,6 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf)
         return _error->Errno("fdopen","Faild to open new FD");
       
       // Feed it the filenames.
-      bool Die = false;
       if (Version <= 1)
       {
         for (vector<Item>::iterator I = List.begin(); I != List.end(); I++)
@@ -339,14 +338,11 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf)
               into the pipe. */
            fprintf(F,"%s\n",I->File.c_str());
            if (ferror(F) != 0)
-           {
-              Die = true;
               break;
-           }
         }
       }
       else
-        Die = !SendV2Pkgs(F);
+        SendV2Pkgs(F);
 
       fclose(F);
       
@@ -660,6 +656,7 @@ bool pkgDPkgPM::OpenLog()
       if (term_out == NULL)
         return _error->WarningE("OpenLog", _("Could not open file '%s'"), logfile_name.c_str());
       setvbuf(term_out, NULL, _IONBF, 0);
+      SetCloseExec(fileno(term_out), true);
       chmod(logfile_name.c_str(), 0600);
       fprintf(term_out, "\nLog started: %s\n", timestr);
    }
@@ -1414,7 +1411,7 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
       {
         while( fgets(buf, sizeof(buf), log) != NULL)
            fprintf(report, " %s", buf);
-        fclose(log);
+        pclose(log);
       }
    }
 
@@ -1430,7 +1427,7 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
       {
         while( fgets(buf, sizeof(buf), log) != NULL)
            fprintf(report, " %s", buf);
-        fclose(log);
+        pclose(log);
       }
    }