]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
database: Re-open the file handle in r+ mode master
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 May 2024 11:10:06 +0000 (12:10 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 May 2024 11:10:06 +0000 (12:10 +0100)
On Mac OS, we cannot re-read our temporary file from the testsuite unless we re-open in r+ mode.

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

index 617b61eb5a8fe5966136aa54c7cc690579fa2bba..7b0fa0910979955d24623b2cfbf85a46c988590b 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;