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)) {