]> git.ipfire.org Git - pakfire.git/commitdiff
compress: Don't rewind on just opened files
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 7 Feb 2025 23:02:24 +0000 (23:02 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 7 Feb 2025 23:02:24 +0000 (23:02 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/compress.c

index f7b4e447ca42705a878f5f293ad86b95a99893f5..245b0aeaaf4c702dee438a678d0335a23a5b61e3 100644 (file)
@@ -694,18 +694,9 @@ struct pakfire_compress {
 
 static int pakfire_copy_data_from_file(struct pakfire_ctx* ctx,
                struct archive* archive, FILE* f) {
-       char buffer[BUFFER_SIZE];
-       int r;
-
-       ssize_t bytes_read = 0;
        ssize_t bytes_written = 0;
-
-       // Read file from the very beginning - also allows calling this multiple times
-       r = pakfire_rewind(f);
-       if (r < 0) {
-               ERROR(ctx, "Could not rewind file for copying: %m\n");
-               return -errno;
-       }
+       ssize_t bytes_read = 0;
+       char buffer[BUFFER_SIZE];
 
        // Loop through the entire length of the file
        while (!feof(f)) {