diff options
-rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 5c7710036..7a0253383 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -840,7 +840,8 @@ bool pkgDPkgPM::OpenLog() // get current time char timestr[200]; time_t const t = time(NULL); - struct tm const * const tmp = localtime(&t); + struct tm tm_buf; + struct tm const * const tmp = localtime_r(&t, &tm_buf); strftime(timestr, sizeof(timestr), "%F %T", tmp); // open terminal log @@ -927,7 +928,8 @@ bool pkgDPkgPM::CloseLog() { char timestr[200]; time_t t = time(NULL); - struct tm *tmp = localtime(&t); + struct tm tm_buf; + struct tm *tmp = localtime_r(&t, &tm_buf); strftime(timestr, sizeof(timestr), "%F %T", tmp); if(d->term_out) |