]> git.ipfire.org Git - location/libloc.git/blobdiff - src/database.c
database: Re-open the file handle in r+ mode
[location/libloc.git] / 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;