X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/ea9e09ef91f688a85d3e04d31163cfe0ef09c59c..d269b88d95686b77a170af203d0f4a7e44d28fc8:/methods/rred.cc 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 #include #include +#include #include @@ -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"));