about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cache.c6
-rw-r--r--ui-patch.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/cache.c b/cache.c
index 6736a01..2ccdc4e 100644
--- a/cache.c
+++ b/cache.c
@@ -224,6 +224,12 @@ static int fill_slot(struct cache_slot *slot)
 	/* Generate cache content */
 	slot->fn();
 
+	/* Make sure any buffered data is flushed to the file */
+	if (fflush(stdout)) {
+		close(tmp);
+		return errno;
+	}
+
 	/* update stat info */
 	if (fstat(slot->lock_fd, &slot->cache_st)) {
 		close(tmp);
diff --git a/ui-patch.c b/ui-patch.c
index 69aa4a8..8007a11 100644
--- a/ui-patch.c
+++ b/ui-patch.c
@@ -92,6 +92,4 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
 		log_tree_commit(&rev, commit);
 		printf("-- \ncgit %s\n\n", cgit_version);
 	}
-
-	fflush(stdout);
 }
> 2021-01-12Don't output a pre in hilex by defaultJune McEnroe 2021-01-12Move hilex out of hilex directoryJune McEnroe 2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe 2021-01-12Split fields by tab onlyJune McEnroe 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe