]> git.ipfire.org Git - location/libloc.git/commitdiff
Revert "database: Re-open the file handle in r+ mode"
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 May 2024 15:46:31 +0000 (15:46 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 May 2024 15:46:31 +0000 (15:46 +0000)
This reverts commit 7654a5beb9b46758af613f15e01f8e0d0b3bd730.

This change breaks the library on Linux.

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

index 7b0fa0910979955d24623b2cfbf85a46c988590b..617b61eb5a8fe5966136aa54c7cc690579fa2bba 100644 (file)
@@ -409,7 +409,7 @@ static int loc_database_clone_handle(struct loc_database* db, FILE* f) {
        }
 
        // Reopen the file so that we can keep our own file handle
-       db->f = fdopen(fd, "r+");
+       db->f = fdopen(fd, "r");
        if (!db->f) {
                ERROR(db->ctx, "Could not re-open database file\n");
                return 1;