#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include <apti18n.h>
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"));