]> git.ipfire.org Git - pakfire.git/commitdiff
archive: Open archives in r+ mode
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 11 Jul 2021 17:06:30 +0000 (17:06 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 11 Jul 2021 17:06:30 +0000 (17:06 +0000)
This allows us to write to the files, too

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

index 0cfb49ddaf984453ebe448e63eb7be836ce0d153..78473993bf6e3d5eb2e77b191d3307f4d584eb1c 100644 (file)
@@ -709,7 +709,7 @@ static int pakfire_archive_try_open(struct pakfire_archive* archive, const char*
        pakfire_string_set(archive->path, path);
 
        // Open the file (and keep the file descriptor open)
-       archive->f = fopen(archive->path, "r");
+       archive->f = fopen(archive->path, "r+");
        if (!archive->f)
                return 1;