X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/12d1f5b3e295c589371bf7de27b7918310d08480..48f3f1b24b48066cfc23342a5c6470ddf5e0fa6a:/ftparchive/multicompress.cc?ds=sidebyside diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc index 1fea589e2..f35d5304a 100644 --- a/ftparchive/multicompress.cc +++ b/ftparchive/multicompress.cc @@ -20,12 +20,15 @@ #include #include #include +#include +#include +#include +#include #include #include -#include +#include #include -#include #include "multicompress.h" #include @@ -234,14 +237,12 @@ bool MultiCompress::Finalize(unsigned long long &OutSize) else { // Update the mtime if necessary - if (UpdateMTime > 0 && + if (UpdateMTime > 0 && (Now - St.st_mtime > (signed)UpdateMTime || St.st_mtime > Now)) { - struct utimbuf Buf; - Buf.actime = Buf.modtime = Now; - utime(I->Output.c_str(),&Buf); + utimes(I->Output.c_str(), NULL); Changed = true; - } + } } // Force the file permissions @@ -367,7 +368,7 @@ bool MultiCompress::Child(int const &FD) for (Files *I = Outputs; I != 0; I = I->Next) { // Set the correct file modes - fchmod(I->TmpFile.Fd(),Permissions); + chmod(I->TmpFile.Name().c_str(),Permissions); if (rename(I->TmpFile.Name().c_str(),I->Output.c_str()) != 0) _error->Errno("rename",_("Failed to rename %s to %s"),