summaryrefslogtreecommitdiff
path: root/methods/rred.cc
diff options
context:
space:
mode:
Diffstat (limited to 'methods/rred.cc')
-rw-r--r--methods/rred.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/methods/rred.cc b/methods/rred.cc
index f7dac3c19..fe7ef7322 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include <apti18n.h>
@@ -597,12 +598,12 @@ class RredMethod : public pkgAcqMethod {
stat(patch_name.c_str(), &bufpatch) != 0)
return _error->Errno("stat", _("Failed to stat"));
- struct timespec times[2];
+ struct timeval times[2];
times[0].tv_sec = bufbase.st_atime;
times[1].tv_sec = bufpatch.st_mtime;
- times[0].tv_nsec = times[1].tv_nsec = 0;
- if (utimensat(AT_FDCWD, Itm->DestFile.c_str(), times, 0) != 0)
- return _error->Errno("utimensat",_("Failed to set modification time"));
+ times[0].tv_usec = times[1].tv_usec = 0;
+ if (utimes(Itm->DestFile.c_str(), times) != 0)
+ return _error->Errno("utimes",_("Failed to set modification time"));
if (stat(Itm->DestFile.c_str(), &bufbase) != 0)
return _error->Errno("stat", _("Failed to stat"));