]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/dpkgpm.cc
* apt-pkg/contrib/mmap.{h,cc}:
[apt.git] / apt-pkg / deb / dpkgpm.cc
index 88098c379c6d6aca1d4b96ea8d0dbb1947b9c14a..fb6054f79446ce0db1359821fb557dcf3997b13e 100644 (file)
@@ -580,10 +580,11 @@ bool pkgDPkgPM::OpenLog()
    if (!logfile_name.empty())
    {
       term_out = fopen(logfile_name.c_str(),"a");
+      if (term_out == NULL)
+        return _error->WarningE(_("Could not open file '%s'"), logfile_name.c_str());
+
       chmod(logfile_name.c_str(), 0600);
-      fprintf(term_out, "\n\nLog started: ");
-      fprintf(term_out, "%s", timestr);
-      fprintf(term_out, "\n");
+      fprintf(term_out, "\nLog started: %s\n", timestr);
    }
 
    // write 
@@ -1062,7 +1063,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
 
         // wait for input or output here
         FD_ZERO(&rfds);
-        if (!stdin_is_dev_null)
+        if (master >= 0 && !stdin_is_dev_null)
            FD_SET(0, &rfds); 
         FD_SET(_dpkgin, &rfds);
         if(master >= 0)