summaryrefslogtreecommitdiff
path: root/ftparchive/multicompress.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-02-27 22:52:34 +0100
committerMichael Vogt <mvo@debian.org>2014-02-27 22:52:34 +0100
commitfce69e7a0f38299c57ef96ae1c1dd9a5379bfd5a (patch)
treebe7d18baa836e9df166ec63f6c9fe6f94bb84b40 /ftparchive/multicompress.cc
parenta5e790985752c6820e08e7a7e650e1607fa826e4 (diff)
parentfc104da6a583736223b2f941e43a05ea26b63a7d (diff)
Merge branch 'debian/sid' into debian/experimental
Conflicts: apt-private/private-list.cc configure.ac debian/apt.install.in debian/changelog
Diffstat (limited to 'ftparchive/multicompress.cc')
-rw-r--r--ftparchive/multicompress.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc
index 1fea589e2..1555d2f2d 100644
--- a/ftparchive/multicompress.cc
+++ b/ftparchive/multicompress.cc
@@ -21,9 +21,10 @@
#include <apt-pkg/error.h>
#include <apt-pkg/md5.h>
+#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <utime.h>
+#include <sys/time.h>
#include <unistd.h>
#include <iostream>
@@ -234,14 +235,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 +366,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"),