]> git.ipfire.org Git - pakfire.git/commitdiff
xfer: Remove restoring the mtime of downloads
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Nov 2023 17:48:03 +0000 (17:48 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Nov 2023 17:48:03 +0000 (17:48 +0000)
The servers don't generally send this information.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/xfer.c

index 9814d983ad1a87d33a024b0d4b89a79573830a46..e7f14ed422f4df59ce4909220abe6f0db15c95bc 100644 (file)
@@ -22,7 +22,6 @@
 #include <fcntl.h>
 #include <limits.h>
 #include <sys/queue.h>
-#include <utime.h>
 
 #include <curl/curl.h>
 
@@ -694,10 +693,6 @@ static const char* curl_http_version(long v) {
 }
 
 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
@@ -723,20 +718,10 @@ static int pakfire_xfer_save(struct pakfire_xfer* xfer) {
        // 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, &times.modtime);
-
-       if (times.modtime > 0) {
-               r = utime(xfer->path, &times);
-               if (r)
-                       CTX_ERROR(xfer->ctx, "Could not set mtime of %s: %m\n", xfer->path);
-       }
-
        return 0;
 }