aboutsummaryrefslogtreecommitdiffstats
path: root/cache.c
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-03-22 11:32:53 +0100
committerFlorian Pritz <bluewind@xinu.at>2018-03-22 11:32:53 +0100
commit343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4 (patch)
tree2be5d6faa22089f8d1b0c1d7e14f283550130370 /cache.c
parente4803632f41cc3f09af6a88511b1d6359be3d325 (diff)
parent33414d7869aa55aaccd45cdb82268d454cb79863 (diff)
downloadcgit-343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4.tar.gz
cgit-343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4.tar.xz
Merge branch 'master' of https://git.zx2c4.com/cgit into local
Diffstat (limited to 'cache.c')
-rw-r--r--cache.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cache.c b/cache.c
index 6736a01..0901e6e 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);
@@ -312,7 +318,7 @@ static int process_slot(struct cache_slot *slot)
/* If the cache slot does not exist (or its key doesn't match the
* current key), lets try to create a new cache slot for this
* request. If this fails (for whatever reason), lets just generate
- * the content without caching it and fool the caller to belive
+ * the content without caching it and fool the caller to believe
* everything worked out (but print a warning on stdout).
*/