diff options
-rw-r--r-- | cache.c | 6 | ||||
-rw-r--r-- | ui-patch.c | 2 |
2 files changed, 6 insertions, 2 deletions
@@ -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); @@ -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); } |