X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/6571bee2e2289b3a183ae3a922551eb743839392..9fcbe2047293f8ef703439264ed3d35701f51638:/apt-pkg/deb/dpkgpm.cc?ds=sidebyside diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index e928776af..f220e2bce 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -591,10 +591,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