#include <fcntl.h>
#include <limits.h>
#include <sys/queue.h>
-#include <utime.h>
#include <curl/curl.h>
}
static int pakfire_xfer_save(struct pakfire_xfer* xfer) {
- struct utimbuf times = {
- .actime = 0,
- .modtime = 0,
- };
int r;
// Flush any buffered data out to disk
// Move the temporary file to its destination
r = linkat(fd, "", AT_FDCWD, xfer->path, AT_EMPTY_PATH);
if (r) {
- CTX_ERROR(xfer->ctx, "Could not link destination file %s: %m\n",
- xfer->path);
+ CTX_ERROR(xfer->ctx, "Could not link destination file %s: %m\n", xfer->path);
return r;
}
- // Filetime
- curl_easy_getinfo(xfer->handle, CURLINFO_FILETIME_T, ×.modtime);
-
- if (times.modtime > 0) {
- r = utime(xfer->path, ×);
- if (r)
- CTX_ERROR(xfer->ctx, "Could not set mtime of %s: %m\n", xfer->path);
- }
-
return 0;
}