about summary refs log tree commit diff
path: root/ui-patch.c
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2017-04-24 19:38:34 +0100
committerJohn Keeping <john@keeping.me.uk>2017-10-03 19:19:34 +0100
commit3b485cc5422f800d142c7023295e82c0a1c10b19 (patch)
treec5c46cdf02c2cff650cc15342c3a5ced861c912c /ui-patch.c
parentUse https for submodule (diff)
downloadcgit-pink-3b485cc5422f800d142c7023295e82c0a1c10b19.tar.gz
cgit-pink-3b485cc5422f800d142c7023295e82c0a1c10b19.zip
cache: flush stdio before restoring FDs
As described in commit 2efb59e (ui-patch: Flush stdout after outputting
data, 2014-06-11), we need to ensure that stdout is flushed before
restoring the file descriptor when writing to the cache.  It turns out
that it's not just ui-patch that is affected by this but also raw diff
which writes to stdout internally.

Let's avoid risking more places doing this by ensuring that stdout is
flushed after writing in fill_slot().

Signed-off-by: John Keeping <john@keeping.me.uk>
Diffstat (limited to 'ui-patch.c')
-rw-r--r--ui-patch.c2
1 files changed, 0 insertions, 2 deletions
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);
 }
amp;id=277186329921ba34630b7a2492e1792133a02c67&follow=1'>Define ColorCap instead of hardcoding 100June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe 2020-02-11Cast towupper to wchar_tJune McEnroe 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe