Commit 27d0e5bd84bca09e4b202bc466a2098cc6447d31

Stefan Sperling 2019-01-12T23:05:44

flush the file index after writing it

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/lib/fileindex.c b/lib/fileindex.c
index 4562e97..efde946 100644
--- a/lib/fileindex.c
+++ b/lib/fileindex.c
@@ -333,6 +333,9 @@ got_fileindex_write(struct got_fileindex *fileindex, FILE *outfile)
 	if (n != sizeof(sha1))
 		return got_ferror(outfile, GOT_ERR_IO);
 
+	if (fflush(outfile) != 0)
+		return got_error_from_errno();
+
 	return NULL;
 }