]> git.ipfire.org Git - location/libloc.git/commitdiff
writer: Flush everything to disk after writing finishes
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Sep 2022 14:28:27 +0000 (14:28 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Sep 2022 14:28:27 +0000 (14:28 +0000)
This might solve a race in the testsuite.

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

index 03599c91394271254b9d55ad5b33dc54838a9498..51e9a8ec2a60957037daba637cf41f0c65428ba5 100644 (file)
@@ -753,5 +753,8 @@ LOC_EXPORT int loc_writer_write(struct loc_writer* writer, FILE* f, enum loc_dat
 
        fwrite(&header, 1, sizeof(header), f);
 
+       // Flush everything
+       fflush(f);
+
        return r;
 }