From: Michael Tremer Date: Sat, 11 May 2024 11:10:06 +0000 (+0100) Subject: database: Re-open the file handle in r+ mode X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Flibloc.git;a=commitdiff_plain database: Re-open the file handle in r+ mode 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 --- diff --git a/src/database.c b/src/database.c index 617b61e..7b0fa09 100644 --- a/src/database.c +++ b/src/database.c @@ -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;