]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/dpkgpm.cc
merged from the mvo branch
[apt.git] / apt-pkg / deb / dpkgpm.cc
index e928776af985310f1225ec4abaf30612edc34991..f220e2bce936d4b8e2811a8b8393c226b950a44c 100644 (file)
@@ -591,10 +591,11 @@ bool pkgDPkgPM::OpenLog()
    if (!logfile_name.empty())
    {
       term_out = fopen(logfile_name.c_str(),"a");
    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);
       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 
    }
 
    // write