From 7a3682b5c9587bce1ac2f4d744d083410cdb7f5e Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 7 Feb 2025 23:02:24 +0000 Subject: [PATCH] compress: Don't rewind on just opened files Signed-off-by: Michael Tremer --- src/pakfire/compress.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/pakfire/compress.c b/src/pakfire/compress.c index f7b4e447..245b0aea 100644 --- a/src/pakfire/compress.c +++ b/src/pakfire/compress.c @@ -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)) { -- 2.39.5